Commit Graph

1028 Commits

Author SHA1 Message Date
auronandace 1ed1096e60 add clippy annotation to netdb thanks to safety note 2025-12-08 08:41:00 +00:00
auronandace 651768ad54 only import the needed types in netdb and poll 2025-12-08 08:34:38 +00:00
auronandace e45c7de6f6 update and add spec links for netdb and poll 2025-12-08 08:30:17 +00:00
auronandace 27bd869119 mark timespec_get and timespec_getres as unsafe and annotate no mangle 2025-12-07 21:07:49 +00:00
Jeremy Soller fe5273890a Merge branch 'cleanup_exec2' into 'master'
Hard code the default scheme to file

See merge request redox-os/relibc!783
2025-12-07 12:37:08 -07:00
bjorn3 4dae665cbf Hard code the default scheme to file
Init no longer changes the default scheme to initfs at any point in
time. And for sandboxing you would be switching scheme namespace, not
default scheme.

It should be possible to mix and match relibc version from before and
after this change without breaking exec, though I haven't tested it.
2025-12-07 19:51:45 +01:00
Jeremy Soller 9ace82b9e1 Merge branch 'printf-negative-precision-fix' into 'master'
printf: use None if precision given in the next argument is negative

See merge request redox-os/relibc!779
2025-12-07 11:29:01 -07:00
auronandace bb7ad19792 only import the needed types for sys_utsname and sys_select 2025-12-07 17:04:59 +00:00
auronandace 64d688dc4e update and add spec links to sys_utsname and sys_select 2025-12-07 17:01:51 +00:00
Connor-GH 1b86d87475 printf: use None if precision given in the next argument is negative 2025-12-07 10:16:33 -06:00
Wildan M 8e4e43dcc4 Fix Dl_info alias not exported 2025-12-05 16:14:29 +07:00
Josh Megnauth 4538fdb0c9 Implement timespec_get and timespec_getres
`timespec_get` and `timespec_getres` are both C23 functions. They're
similar to the POSIX functions `clock_gettime` and `clock_getres`, but
both sets of functions define extra, exclusive features. I didn't
implement the extra features yet, partially because Redox doesn't seem
to support them yet either.
2025-12-04 20:38:35 +00:00
auronandace 1ce298eaa9 only import needed types in locale and sched 2025-12-04 09:11:57 +00:00
auronandace f0850889d2 update and add spec links to locale and sched 2025-12-04 09:08:14 +00:00
auronandace 1e27ad561f only import needed types in sys_socket and sys_stat 2025-12-03 14:16:19 +00:00
auronandace cae30932b3 update and add spec links in sys_socket and sys_stat 2025-12-03 14:06:55 +00:00
auronandace 5e6c9b8868 make Dl_info_t the type and Dl_info the alias 2025-12-02 20:26:28 +00:00
auronandace a702cb9555 only imported needed types in dlfcn 2025-12-02 20:24:05 +00:00
auronandace 68b4693564 only import needed types in sys_wait 2025-12-02 19:37:16 +00:00
auronandace ec9fd09335 update header spec link, add spec links to functions 2025-12-02 19:34:32 +00:00
auronandace ccc1d0b6fe remove commented out wait3 and rusage 2025-12-02 19:30:19 +00:00
auronandace 02b302253b only import the needed types in sys_un and sys_uio 2025-12-02 15:41:01 +00:00
auronandace 44cd0971b1 update header spec reference and add spec references to functions 2025-11-29 17:48:56 +00:00
auronandace 329db0dd9c add Dl_info_t alias for Dl_info 2025-11-29 15:33:31 +00:00
auronandace a25cf92162 update header reference and add references to functions 2025-11-29 15:22:39 +00: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
Jeremy Soller 339e97ac65 Fix type of ai_addrlen 2025-11-21 11:37:16 -07:00
Jeremy Soller 01f01d3bd4 Fix for F_DUPFD_CLOEXEC, add TODO for usage in upper table 2025-11-17 17:46:57 -07:00
Jeremy Soller db2600881f Add F_DUPFD_CLOEXEC 2025-11-17 17:44:49 -07:00
Jeremy Soller c6849f21e4 Fix compilation on i586 2025-11-16 08:54:54 -07:00
Jeremy Soller 0844e6fc90 WIP: use upper fd table 2025-11-15 07:55:37 -07:00
Jeremy Soller afb8f46020 Implement ppoll 2025-11-13 10:47:29 -07:00
4lDO2 512c4f0aa8 Clarification of st_mode bits extraction code. 2025-11-12 12:10:11 +01:00
Jeremy Soller 32b3d2d343 Fix pthread key collision 2025-11-10 15:40:34 -07:00
4lDO2 4855cf3875 Fix compilation on Linux. 2025-11-08 17:31:57 +01:00
4lDO2 3ad0420b85 Add derive macro to check types vs libc crate. 2025-11-08 17:30:34 +01:00
Jeremy Soller 16814d2e32 Fix socklen_t type 2025-11-07 18:10:17 -07:00
Jeremy Soller a33bb699e6 Remove weak linkage from getopt functions and globals 2025-10-30 14:39:27 -06:00
Jeremy Soller c2eed49e2d Add NAME_MAX 2025-10-29 12:30:28 -06: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
Wildan M c8fce67873 Support SIGEV_SIGNAL and TIMER_ABSTIME 2025-10-16 22:37:24 +07:00
Jeremy Soller 6092acc5bd Merge branch 'timer-fn' into 'master'
Implement POSIX timer functions

See merge request redox-os/relibc!747
2025-10-15 08:10:06 -06:00
Wildan Mubarok 2efcd20fbc Implement POSIX timer functions 2025-10-15 08:10:06 -06:00
auronandace e4eada2e52 update spec links and imports for assert and fcntl headers 2025-10-12 17:25:03 +01:00
Jeremy Soller d50ce16e0f Merge branch 'add-posix-dent' into 'master'
Define posix_dent for posix_getdents

See merge request redox-os/relibc!746
2025-10-12 08:23:36 -06:00
Wildan M 135fba1f9f rename posix_dent d_off 2025-10-12 20:37:21 +07:00
Wildan M 1712290deb Define posix_dent for posix_getdents 2025-10-12 20:25:37 +07:00
auronandace 03c646222e update spec links and imports for libgen and sys_resource 2025-10-11 19:21:36 +01:00
Jeremy Soller 02e4d98020 Merge branch 'panic-strlen' into 'master'
Avoid panic by uninitialized string of strlen

See merge request redox-os/relibc!744
2025-10-09 10:58:28 -06:00