Commit Graph

500 Commits

Author SHA1 Message Date
4lDO2 c25b4c67e1 Add kill-waitpid test. 2025-04-19 19:27:02 +02:00
4lDO2 37b60b67e0 Add and fix test for kill&waitpid. 2025-04-19 19:27:02 +02:00
4lDO2 0083043736 Write and fix waitpid_multiple test. 2025-04-19 19:27:02 +02:00
4lDO2 134914c580 Expand waitpid test. 2025-04-19 19:27:00 +02:00
4lDO2 c99e9c7db3 Add waitpid test back. 2025-04-19 19:27:00 +02:00
4lDO2 2fb247266b Fix typo in pthread_exit test. 2025-04-19 19:27:00 +02:00
4lDO2 9e769fcb57 Add pthread_exit test.
This caught a bug in the kernel where it would return Ok(24) when
passing zero extra-munmap length.
2025-04-19 19:27:00 +02:00
Josh Megnauth a4826bd48c Implement BSD's err.h 2025-04-18 12:34:45 +00:00
Josh Megnauth 090391d94f fix(strptime): Don't clobber struct tm
Our strptime implementation uses subformatting to handle specifiers that
expand to other specifiers. For example, '%T' expands to "%H:%M%:%S".
Relibc calls strptime again to handle '%T' by expanding it.

However, our strptime zeroes out struct tm which clobbers old values. If
strptime is called with a format string like "%D%t%T", the set values
for '%D' are clobbered.

Zeroing out the struct is extra, unneeded work as well. The user may
want to preserve old values. We don't read from struct tm so we don't
have to worry about invalid values. Finally, `musl` and `glibc` don't
clear the values either so we can default to their behavior.
2025-04-01 23:35:29 -04:00
Darley Barreto 26573d02d1 Time improvements 2025-03-29 19:29:20 +00:00
Josh Megnauth e827b4f61f Add strptime tests 2025-03-29 14:01:29 +00:00
GrayJack c7d94ae4d7 feat(c23): Implement %b and %B format 2025-03-22 20:15:56 -03:00
Josh Megnauth ccc1b7f560 strftime: ISO-8601 leap weeks 2025-03-20 02:34:26 -04:00
Darley Barreto dda7142385 Few improvements to time.h 2025-02-26 23:58:57 +00:00
Jeremy Soller 56a1d9c3e9 Merge branch 'pvalloc2' into 'master'
Add pvalloc()

See merge request redox-os/relibc!614
2025-02-12 17:58:25 +00:00
Peter Limkilde Svendsen b3f36faf87 Add pvalloc() 2025-02-11 21:13:51 +01:00
Ron Williams 6ea993bf46 Fix sigqueue test 2025-02-07 22:04:01 +00:00
Jeremy Soller e7a24b3f7f Merge branch 'sleep-intr' into 'master'
Make nanosleep and sleep handle interrupts correctly, plus fix alarm

See merge request redox-os/relibc!605
2025-01-31 21:10:15 +00:00
Ron Williams c528c0885f Make nanosleep and sleep handle interrupts correctly, plus fix alarm 2025-01-31 21:10:14 +00:00
Peter Limkilde Svendsen 38d22bd735 Suppress warnings about deprecated declarations in C 2025-01-30 21:41:52 +01:00
Jeremy Soller 25b0da4876 Merge branch 'sigsetjmp_x64_implementation' into 'master'
Implement sigsetjmp and siglongjmp for X64

See merge request redox-os/relibc!478
2025-01-04 00:29:19 +00:00
Bendeguz Pisch 35a3efd936 Implement sigsetjmp and siglongjmp for X64 2025-01-04 00:29:19 +00:00
Darley Barreto c14b2cee4c Adding tzset, timezone awareness, and some tweaks 2025-01-02 20:19:34 +00:00
Jeremy Soller f08952b1b0 Merge branch 'patch5' into 'master'
feat: rwlock

Closes #196

See merge request redox-os/relibc!594
2024-12-30 17:17:05 +00:00
Anhad Singh 4232858b89 misc(tests/ptrace): update expected
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-31 00:54:58 +11:00
Anhad Singh 2c307616d8 fix(tests/ptrace.c): persistent logs
Even though it might seem like it, it is not necessary that write(2) is
the only system call performed. It could be that the libc has to
allocate memory (via MMAP) or makes use of a futex. To produce
consistant results, only log on SYS_write and when the syscall number
has been patched.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-31 00:54:58 +11:00
Ron Williams a4ca5b4e85 fix popen tests 2024-12-28 16:34:27 -08:00
Darley Barreto ae5a5256b4 Add missing functions to string.h 2024-12-28 22:46:45 +00:00
Ron Williams 9df3708a1a fix popen, improve tests 2024-12-26 17:14:15 -08:00
Anhad Singh 1ffd7187ef feat(dlfcn): define RTLD_DEFAULT
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-25 19:27:31 +11:00
Anhad Singh 2be4316aec feat(dlfcn): return DSO as the handle
Fine because:
> The value of this handle should not be interpreted in any way by the
> caller.
From: https://pubs.opengroup.org/onlinepubs/009696599/functions/dlopen.html

* Add tests for unload
* Implement NOLOAD so we can test that the loaded object has been
  destroyed.
* Minor cleanup.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-25 16:17:51 +11:00
Anhad Singh 1db68ab978 feat(ld.so): scopes
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-24 20:51:53 +11:00
Peter Limkilde Svendsen 93b6374d1e Reimplement memcpy() using slices, fix unaligned read/write, add test 2024-12-23 19:14:44 +00:00
bitstr0m 5d6ae507e1 Implement glob.h 2024-12-12 15:17:16 +00:00
Anhad Singh a527cc53ea tests(pthread): status must be 0 if not leader
Fix CI break.

man pthread_barrier_wait(3)
> ...the constant PTHREAD_BARRIER_SERIAL_THREAD shall be returned to
> one *unspecified* thread and zero shall be  returned  to  each  of  the  remaining
> threads.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-05 16:24:10 +11:00
Anhad Singh e8e6b8cbc5 fix(expected): dynamic bins
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-26 19:51:06 +11:00
Anhad Singh cdb4843164 fix(tests): fix UB in mk{fifo,nod,nodat}
Memory chunk is allocated with `malloc` and used as the `dest` buffer
for `strncat`. The `dest` argument in `strncat` has to be NUL terminated,
however it was not.

This commit fixes this issue in mk{fifo,nod,noat}.c.

Almost all dynamic tests pass now.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-26 16:56:05 +11:00
Anhad Singh 22bbdb025c misc(tests): fix compilation of dlfcn.c
From man dlopen(3)
> According to the ISO C standard, casting between function
> pointers and 'void *', as done above, produces undefined results.
> POSIX.1-2001 and POSIX.1-2008 accepted this state of affairs and
> proposed the following workaround:
>
>   *(void **) (&cosine) = dlsym(handle, "cos");
>
> This (clumsy) cast conforms with the ISO C standard and will
> avoid any compiler warnings.
>
> The 2013 Technical Corrigendum 1 to POSIX.1-2008 improved matters
> by requiring that conforming implementations support casting
> 'void *' to a function pointer.  Nevertheless, some compilers
> (e.g., gcc with the '-pedantic' option) may complain about the
> cast used in this program.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-25 18:00:03 +11:00
Anhad Singh 6020c54ce7 chore(test): add expected outputs for dynamic tests
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-25 16:16:07 +11:00
Anhad Singh 00746c2566 misc(tests): disable dlfcn test for now
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-25 12:31:33 +11:00
Anhad Singh 7aa340570f chore: enable dynamic tests
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-11-25 12:13:03 +11:00
Josh Megnauth daa77e7149 Temporarily disable noreturn attribute test 2024-11-24 13:55:05 +00:00
Jeremy Soller 2c73cc947c Merge branch 'memmem' into 'master'
Implement memmem()

See merge request redox-os/relibc!560
2024-11-17 16:18:15 +00:00
Peter Limkilde Svendsen 6a765ed88f Implement memmem() 2024-11-17 16:18:14 +00:00
Jeremy Soller 09bcfd0711 Merge branch 'errno-const-macros' into 'master'
Test errno constant macros, make ENOTSUP available in Rust

See merge request redox-os/relibc!556
2024-11-17 16:16:47 +00:00
Peter Limkilde Svendsen 42011f28d8 Test errno constant macros, make ENOTSUP available in Rust 2024-11-17 16:16:47 +00:00
Jeremy Soller caac784caa Merge branch 'iso646' into 'master'
Add iso646.h and corresponding tests

See merge request redox-os/relibc!555
2024-11-17 16:16:11 +00:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Peter Limkilde Svendsen 56d05e2cdc Add iso646.h and corresponding tests 2024-11-10 16:19:15 +01:00
Josh Megnauth bf1ea4e799 Set h_errno for gethostbyname/addr 2024-11-02 12:21:47 +00:00