Commit Graph

4364 Commits

Author SHA1 Message Date
Connor-GH e2486379b1 Remove redundant code and impl them in terms of *at functions
The following functions were replaced with their *at variants or
similar:
- lstat -> lstat -> fstatat
- stat -> stat -> fstatat
- fstat -> fstatat
- fchmod -> fchmodat
- fchown -> fchownat
- lchown -> fchownat
- mkfifo -> mkfifoat
- open -> openat
- renameat -> renameat2
- rmdir -> unlinkat
- unlink -> unlinkat
- symlink-> symlinkat

The `open_flags` logic for fstatat was redundant, as this is already
handled (and better so) in `openat2`.

Additionally, the fstatat test succeeds in os-test, and no longer
returns EINVAL. This is because `O_SYMLINK` is no longer
unconditionally passed like it was before. This is a problem because
redoxfs returns EINVAL if a node isn't a symlink but set `O_SYMLINK`.
2026-05-05 15:30:46 -05:00
Jeremy Soller 5312b86ee5 Merge branch 'fix-semaphore' into 'master'
include fcntl in semaphore header to fix includes

See merge request redox-os/relibc!1267
2026-05-05 11:49:13 -06:00
Jeremy Soller f500e637c3 Merge branch 'utimensat' into 'master'
add utimensat

See merge request redox-os/relibc!1268
2026-05-05 11:49:05 -06:00
Connor-GH 03103893ef add utimensat
This addition removes duplicated code and also passes an os-test.

The `AT_EMPTY_PATH` duplicated code will be taken care of in the future.
2026-05-05 10:42:32 -05:00
auronandace aae576b4a0 include fcntl in semaphore header to fix includes 2026-05-05 16:00:24 +01:00
Jeremy Soller ad4fa52f96 Merge branch 'unified-alarm' into 'master'
Unify alarm implementation

See merge request redox-os/relibc!1266
2026-05-05 07:07:08 -06:00
Jeremy Soller 518b597082 Merge branch 'preaslr' into 'master'
Link Scrt1 to crt0 for linux relibc

See merge request redox-os/relibc!1265
2026-05-05 06:44:10 -06:00
Jeremy Soller 4137ac1d8a Merge branch 'qsort_r' into 'master'
Implement qsort_r

See merge request redox-os/relibc!1264
2026-05-05 06:42:28 -06:00
Jeremy Soller 2e7d1bdb60 Merge branch 'utimensat' into 'master'
Implement utimensat

See merge request redox-os/relibc!1263
2026-05-05 06:40:37 -06:00
Wildan M 90cb143523 Unify alarm implementation 2026-05-05 09:35:50 +07:00
Wildan M 39a1f7b223 Link Scrt1 to crt0 for linux relibc 2026-05-05 06:56:00 +07:00
Wildan M 5c253e3cc8 Implement qsort_r 2026-05-05 02:54:17 +07:00
Jeremy Soller 6b3ba5b2d9 Merge branch 'fix-chmod-regression' into 'master'
fix test regression caused by !1250

See merge request redox-os/relibc!1262
2026-05-04 13:40:22 -06:00
Connor-GH 1016fdf01e fix test regression caused by !1250
MR https://gitlab.redox-os.org/redox-os/relibc/-/merge_requests/1250 was
done in order to try and patch out an `EINVAL` error, and it was
successful in doing so. Unfortunately, fixing one failure caused
another.

I will continue to do what I can to make relibc's FS layer and redoxFS
smaller, as they have way too much duplicated code.
2026-05-04 14:20:02 -05:00
Wildan M 7aba041004 Implement utimensat 2026-05-05 02:02:43 +07:00
Jeremy Soller 36d2efa334 Merge branch 'more-redox-pal-cleanups' into 'master'
platform/redox: migrate more functions to use their *at variants

See merge request redox-os/relibc!1261
2026-05-04 11:48:45 -06:00
Connor-GH cf65eedbaf platform/redox: migrate more functions to use their *at variants
Additionally, this adds the `SYMLOOP_MAX` constant in `limits.h` to
replace the `MAX_LEVEL` magic number used during symlink resolution.

`fstat` was kept because it is more difficult than the others to do a
drop-in replacement in terms of `fstatat` for since a naive approach
would cause mutual recursion.
2026-05-04 11:44:53 -05:00
Jeremy Soller 5b6b2a3f17 Merge branch 'split-timeval' into 'master'
split out timeval to reduce namespace pollution

See merge request redox-os/relibc!1260
2026-05-04 09:14:32 -06:00
auronandace f6f4d8f71d export struct via function 2026-05-04 15:22:19 +01:00
auronandace 2dd36566de split out timeval to reduce namespace pollution 2026-05-04 15:05:30 +01:00
Jeremy Soller 4bff41fe78 Merge branch 'epoll-event-needless-update' into 'master'
address needless_update clippy lint for epoll_event

See merge request redox-os/relibc!1259
2026-05-04 07:32:44 -06:00
Jeremy Soller a93268f247 Merge branch 'split-susecondst' into 'master'
split out suseconds_t for namespace pollution reduction preparation

See merge request redox-os/relibc!1258
2026-05-04 07:07:24 -06:00
Jeremy Soller 17a4f143b4 Merge branch 'verify-time-includes' into 'master'
verify time header includes

See merge request redox-os/relibc!1257
2026-05-04 07:06:52 -06:00
auronandace 400448b011 address needless_update clippy lint for epoll_event 2026-05-04 14:05:41 +01:00
auronandace 1cd9d8769d split out suseconds_t for namespace pollution reduction preparation 2026-05-04 13:38:33 +01:00
auronandace 1edd7a63d7 verify time header includes 2026-05-04 09:05:32 +01:00
Jeremy Soller 76f5c6a882 Merge branch 'socklent-cleanup' into 'master'
import socklen_t from sys_socket instead of bits

See merge request redox-os/relibc!1256
2026-05-03 10:09:48 -06:00
auronandace 8cec0c2280 import socklen_t from sys_socket instead of bits 2026-05-03 16:54:46 +01:00
Jeremy Soller 9fd1da5d92 Merge branch 'linux' into 'master'
Add linux-relibc target support

See merge request redox-os/relibc!1255
2026-05-03 09:00:22 -06:00
Jeremy Soller 6c5435fcf8 Merge branch 'timespec-cleanup' into 'master'
import timespec from time rather than bits

See merge request redox-os/relibc!1254
2026-05-03 08:57:03 -06:00
auronandace 5ad5058324 fix typo 2026-05-03 14:43:34 +01:00
auronandace 05b8ffbcb7 import timespec from time rather than bits 2026-05-03 14:33:39 +01:00
Jeremy Soller 135753d0e6 Merge branch 'split-timet' into 'master'
Split timet

See merge request redox-os/relibc!1253
2026-05-03 06:20:16 -06:00
Jeremy Soller b16a00f7dd Merge branch 'type-write' into 'master'
Refactor internal timer to fix alarm test

See merge request redox-os/relibc!1236
2026-05-03 06:17:03 -06:00
auronandace 356d2e18d2 cargo fmt and fix clippy lints in fmtmsg 2026-05-03 08:35:29 +01:00
auronandace 8d2bcee829 split out time_t to prepare for reducing namespace pollution 2026-05-03 08:30:35 +01:00
Wildan M c72a9c276b Add linux-relibc target support 2026-05-03 07:07:44 +07:00
Wildan M ea667cdca1 Support disarming timer 2026-05-03 05:06:25 +07:00
Jeremy Soller fc0aa8471a Merge branch 'sigset-t' into 'master'
FIx sigjmp_buf and add tests

See merge request redox-os/relibc!1252
2026-05-02 16:06:21 -06:00
Wildan M 9188a9e354 Make timer_internal_t atomic 2026-05-03 05:02:29 +07:00
Wildan M d16dfade59 Use less cloning for timespec 2026-05-03 03:21:06 +07:00
Wildan M 7b0354ca3d Use type casts for timespec conversion 2026-05-03 03:09:52 +07:00
Jeremy Soller 08fc95fce2 Merge branch 'epoll-types' into 'master'
Fix types for sys/epoll

See merge request redox-os/relibc!1251
2026-05-02 07:55:32 -06:00
Wildan M 043ec22076 FIx sigjmp_buf and add tests 2026-05-02 16:59:48 +07:00
Wildan M 64911d582f Fix types for sys/epoll 2026-05-02 15:02:41 +07:00
Jeremy Soller 397eb503ed Merge branch 'fchownat-openat2-fix' into 'master'
openat2: fix internal assumption causing EINVAL

See merge request redox-os/relibc!1250
2026-05-01 16:39:02 -06:00
Connor-GH 76d801f7cd openat2: fix internal assumption causing EINVAL
Inside of `openat2`, we are assuming that if we are passed
`AT_SYMLINK_NOFOLLOW` that we are also passed a symlink. This is simply
not the case, as POSIX defines the flag to only have a noticable effect
if the resolved path is a symlink. Therefore, we cannot assume that we
have a symlink if we see `AT_SYMLINK_NOFOLLOW`. The previous behavior
caused an `EINVAL` in redoxfs because we do a consistency check to
error out if we are passed `O_SYMLINK` (which was added because
`AT_SYMLINK_NOFOLLOW` was observed) and aren't a symlink.

Hmm, maybe a special errno like `ENOTLNK` should be deployed for this? It's
specific enough that it could possibly be added to a future POSIX.
2026-05-01 17:01:39 -05:00
Jeremy Soller 19d380f198 Merge branch 'misc-clippy-fixes' into 'master'
fix some lints caught by Clippy

See merge request redox-os/relibc!1248
2026-05-01 07:04:57 -06:00
Jeremy Soller 49a72d73c8 Merge branch 'fmtmsg-constants' into 'master'
add and document missing constants in fmtmsg

See merge request redox-os/relibc!1249
2026-05-01 07:04:32 -06:00
auronandace d057fdd40a add and document missing constants in fmtmsg 2026-05-01 13:39:45 +01:00