Commit Graph

87 Commits

Author SHA1 Message Date
sourceturner abbae3dce6 add basic unit test for posix timers (time/timer) 2026-05-24 19:12:05 +02:00
Wildan M e9f8b0c697 Merge expect files 2026-05-08 17:57:18 +07:00
Wildan M 796b1d8ef5 Remove empty stderr expect 2026-05-08 17:48:25 +07:00
Wildan M 7aba041004 Implement utimensat 2026-05-05 02:02:43 +07:00
Wildan M 043ec22076 FIx sigjmp_buf and add tests 2026-05-02 16:59:48 +07:00
Wildan M 598d34d8a0 Fix open permission and add umask test 2026-04-30 16:08:05 +07:00
nicoan 2c4a20e71b added tests to scanf and wscanf 2026-04-15 15:38:40 -03:00
nicoan da3ff538d6 WIP: fixing regressions 2026-04-15 14:18:20 -03:00
Zero 5cbb4ba0cc test(unistd): Add alarm(2) test
Introduce a new test for the alarm(2) system call.
This test verifies the behavior of setting, cancelling,
and re-arming alarms, ensuring correct signal delivery
and return values.
2026-03-31 00:09:07 +02:00
Wildan M 38650d994e Fix fnmatch caused oom 2026-03-29 02:20:16 +07:00
Wildan M d7c14e94af Wrap tests in a separate build directory 2026-03-25 03:05:47 +07:00
Wildan M b93e24b1d6 Implement long double in printf 2026-03-04 22:03:31 +07:00
Wildan M d18a4da715 Add failed epollet test 2026-02-11 17:00:17 +07:00
Wildan M e2b8acb05d Add test for data transfer before accept for UDS 2026-02-06 14:17:45 +07:00
Josh Megnauth 02f766b8df Add more 'open' tests 2026-01-24 15:34:24 -07:00
Wildan M 675a60bd9a Fix unixpeername expected stdout 2026-01-22 19:06:29 +07:00
Wildan M 3bf35abeae Add more sys_socket tests 2026-01-16 07:18:13 +07:00
Wildan M 1e587dc77b Add putc_unlocked tests 2026-01-05 12:43:51 +07:00
Wildan M 7d1c3961b5 Implement malloc_usable_size 2026-01-04 02:15:29 +07:00
Wildan M 19d95a226c Add tests for new locale.h functions 2025-12-27 22:25:01 +07:00
auronandace c2da2a8e47 fix expected output of strcpy test 2025-12-15 08:28:25 +00:00
Jeremy Soller 8ad1d3c110 Merge branch 'fix-netdb-test' into 'master'
Move netdb to varied output test

See merge request redox-os/relibc!766
2025-11-29 06:44:56 -07:00
Wildan M 7e48f2d2fc Move netdb to varied output test 2025-11-28 19:08:32 -08:00
Josh Megnauth 8e5937ca25 Implement posix_fallocate
`posix_fallocate` ensures that a byte range in a file is allocated so
that subsequent writes don't fail. Unlike ftruncate, posix_fallocate
does not shrink files.

The Linux syscall fallocate is similar to posix_fallocate except with
far more control over how byte ranges are allocated (e.g. it supports
file holes and other features). This MR doesn't implement fallocate as
it requires syscall and redoxfs support.

Finally, I changed the flags for flock from usize to c_int. That matches
what we have in libc and also avoids some silly, needless type casting.
2025-11-28 19:49:21 -05:00
Wildan M 8e16c9c80c Fix getsubopt and add test 2025-11-28 06:59:51 -08:00
Josh Megnauth f5d432644f Implement renameat, renameat2
Like the other "at" functions, renameat renames files with respect with
a directory descriptor. "renameat2" is Linux specific but really nice -
it adds a flag which supports atomically swapping two files or failing
if the target already exists. The latter is easily supported in relibc.
The former requires redoxfs support.

Besides the impl itself, I refactored "cap_path_at" into what it really
is: a mini openat2-like function.
2025-10-21 14:47:39 -04:00
Josh Megnauth 85c5e889fb Implement fchmodat
Capability based `fchmod`. I also implemented unit tests for chmod,
fchmod, and fchmodat.

The unit tests check Redox-specific behavior, so some of the tests are
disabled for Linux.
2025-09-21 10:04:11 -04:00
Josh Megnauth c555503a35 Implement readlinkat
Like readlink except capability based. Most of this patch is refactoring
fstatat into a reusable, openat-like private function.
2025-09-18 01:27:55 +00:00
Josh Megnauth c6a9a165ec Implement fdopendir and fdclosedir
`fdopendir` takes ownership of a directory file descriptor instead of
opening one with a path. `fdclosedir` is a FreeBSD extension that
transfers ownership of the file descriptor in DIR to the user.
2025-09-17 08:24:48 -04:00
Josh Megnauth 639e0f2cd7 Add lstat test 2025-09-05 23:59:36 -04:00
Josh Megnauth c899feb774 Implement fstatat
Linux's variant uses the syscall as intended. Redox's variant uses fpath
to build a path to pass to fstat from the file descriptor plus the file
name. Unlike the syscall, this isn't atomic so the liminal space between
fpath/getcwd and fstat is subject to TOCTOU.

Beyond fstatat, I moved the stat test to its correct location and added
an assert since the output of the test is unchecked.

I also added AT_FDCWD which seems to be -100 across Unixes. The other
AT_* constants are unimplemented for now.
2025-08-27 08:21:41 -04:00
Josh Megnauth 9d2f5d95dc Implement confstr (unistd.h)
The implementation for confstr is straightforward. Most of the constants
return 1 on both musl and glibc. The only constant that doesn't is
required for Fish.

I also switched an #[unsafe(no_mangle)] from my last patch back
to a #[no_mangle] because we need to bump cbindgen. #[unsafe(no_mangle)]
is required for Rust 2024.
2025-08-22 22:13:51 -04:00
Josh Megnauth c3c9e3f619 Add termios constant for VDISABLE
_POSIX_VDISABLE is an extension that disables terminal special
characters.

See:
* redox-os/termios!3
* redox-os/base!27
2025-08-14 01:57:24 -04:00
Josh Megnauth 728fb55203 Add %m to printf & fix CI
%m is a format specifier that prints an error string for errno. The
specifier is technically only for syslog, but musl and glibc implement
it for printf itself. Parsing for a single specifier in a single
function is error prone, especially when syslog itself is variadic.
2025-08-06 02:38:47 -04:00
Josh Megnauth 292a4b18a9 Move syslog tests to correct location 2025-08-04 22:20:17 -04:00
Josh Megnauth e677ad55d5 Better priorities & LOG_UPTO for syslog.h
* Fix PERROR to match musl/glibc better
* More unit tests + enabled on Linux
* Pack priority and facility into one i32 and check the bits with
  bitflags
* Add LOG_UPTO (logic is straight from musl)

Not done:
* "%m" - this could just be added to printf
* LOG_CONS
2025-08-01 23:45:26 -04:00
Ron Williams 770dc71816 Fix CI, Add signal.h constants 2025-07-11 20:28:45 -06:00
Jeremy Soller a2e040ce4d Merge branch 'strto-detect-endptr' into 'master'
Fix strtol/ul endptr with detected base

See merge request redox-os/relibc!656
2025-05-02 10:36:05 -06:00
Arne de Bruijn de3dd54266 Fix strtol/ul endptr with detected base
The "0" or "0x" characters with base 0 were not accounted for in the
returned endptr value.
2025-05-02 12:18:34 +02:00
Josh Megnauth a4826bd48c Implement BSD's err.h 2025-04-18 12:34:45 +00: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
Peter Limkilde Svendsen b3f36faf87 Add pvalloc() 2025-02-11 21:13:51 +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