Commit Graph

2819 Commits

Author SHA1 Message Date
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
auronandace d057fdd40a add and document missing constants in fmtmsg 2026-05-01 13:39:45 +01:00
Mustafa öz 03d56f4887 Add fmtmsg 2026-05-01 06:00:11 +01:00
Connor-GH 7c8259dfd6 fix some lints caught by Clippy
Most of these changes are very simple. Among the changes made involve
taking advantage of auto-deref (`(*val).foo()` -> `val.foo()`) and
removing instances where we create a ref and immediately dereference it
(`&*val` -> `val`). There was a pretty neat case in `posix_openpt` where
some pointer verbosity was able to be reduced by using the more modern C
strings rather than the byte strings with an explicit NUL at the end.

Additionally, `exit()` now calls `unreachable!()` at the end. We
previously did `loop {}`, but clippy didn't like this. It can be up for
debate whether we want to make this `unreachable_unchecked` or similar.

There is only one change that might cause any sort of concern, and that
is the change from `.skip_while(!p).next()` -> `.find(p)`. This, like
everything else, was caught in a Clippy lint but I believe it deserves
some explanation because it isn't immediately obvious. Info about the
lint is here: https://rust-lang.github.io/rust-clippy/rust-1.89.0/index.html#skip_while_next
2026-04-30 19:02:35 -05:00
Jeremy Soller c1912066a1 Merge branch 'poll-descriptions' into 'master'
add some descriptions for items in the poll header

See merge request redox-os/relibc!1247
2026-04-30 11:11:43 -06:00
Jeremy Soller 9629d50c89 Merge branch 'open-fix' into 'master'
Fix open permission and add umask test

See merge request redox-os/relibc!1246
2026-04-30 11:11:05 -06:00
Jeremy Soller 55d5d6048c Merge branch 'verify-sysselect-includes' into 'master'
verify sys_select header includes

See merge request redox-os/relibc!1245
2026-04-30 11:10:47 -06:00
auronandace 524a9fb634 add some descriptions for items in the poll header 2026-04-30 10:29:28 +01:00
Wildan M 598d34d8a0 Fix open permission and add umask test 2026-04-30 16:08:05 +07:00
auronandace 6fafb81f02 verify sys_select header includes 2026-04-30 08:56:19 +01:00
auronandace e1b39d786f verify poll header includes 2026-04-30 08:23:05 +01:00
Connor-GH 22faf6b615 fchownat: fix behavior for uid == -1 && gid == -1
Previously, this would error with EINVAL since the conversion to
unsigned int would fail on -1. Now, we do a bitwise conversion via
an `as` cast.
2026-04-29 15:23:56 -05:00
Jeremy Soller 861bbb024a Merge branch 'split-sigset-t' into 'master'
split out sigset_t from signal header

See merge request redox-os/relibc!1242
2026-04-29 06:51:47 -06:00
Jeremy Soller 7747064459 Merge branch 'sys-utsname-tar' into 'master'
disambiguate include guards and export C strings

See merge request redox-os/relibc!1241
2026-04-29 06:51:06 -06:00
Jeremy Soller ad36f13c9a Merge branch 'mesa-strings' into 'master'
import strings header in string for mesa

See merge request redox-os/relibc!1240
2026-04-29 06:50:45 -06:00
Jeremy Soller 250d42880f Merge branch 'sys-stat-statvfs' into 'master'
disambiguate include guards for sys_stat and sys_statvfs

See merge request redox-os/relibc!1239
2026-04-29 06:46:41 -06:00
Jeremy Soller bb496ce10a Merge branch 'unistd-trailer' into 'master'
change unistd cbindgen trailer to after_includes

See merge request redox-os/relibc!1238
2026-04-29 06:40:59 -06:00
auronandace 6a490be2c6 split out sigset_t from signal header 2026-04-29 12:29:43 +01:00
auronandace 323061f51c disambiguate include guards and export C strings 2026-04-29 10:36:13 +01:00
auronandace 4dfbb97a69 import strings header in string for mesa 2026-04-29 09:57:11 +01:00
auronandace d86583c1f5 disambiguate include guards for sys_stat and sys_statvfs 2026-04-29 09:01:50 +01:00
auronandace 88ac8e3f30 change unistd cbindgen trailer to after_includes 2026-04-29 08:30:55 +01:00
auronandace 798d929254 remove unused C header 2026-04-29 08:09:37 +01:00
bjorn3 79b469f29d Remove support for _init and _fini in statically linked executables
These are legacy predecessors of .init_array/.fini_array. They were
already not supported by the dynamic linker.
2026-04-28 17:59:45 +02:00
bjorn3 e34b259822 Cleanup building of libc.so and ld.so 2026-04-28 17:16:30 +02:00
Jeremy Soller 6c2edd8efd Merge branch 'verify-sysmman-includes' into 'master'
verify sys_mman header includes

See merge request redox-os/relibc!1234
2026-04-27 12:27:28 -06:00
auronandace 31052b5ef5 verify sys_mman header includes 2026-04-27 16:06:17 +01:00
auronandace df5deb2b59 use uint32_t for n_net in netent 2026-04-27 15:09:53 +01:00
Jeremy Soller a6df5229f4 Merge branch 'sysuio-include-guard' into 'master'
disambiguate sys_uio include guard

See merge request redox-os/relibc!1232
2026-04-27 06:56:05 -06:00
Jeremy Soller 0de8734ff4 Merge branch 'verify-string-includes' into 'master'
verify string header includes

See merge request redox-os/relibc!1231
2026-04-27 06:56:02 -06:00
Jeremy Soller 9cfa1e50eb Merge branch 'sysresource-trailer' into 'master'
change trailer to after_includes for sys_resource

See merge request redox-os/relibc!1230
2026-04-27 06:55:57 -06:00
Jeremy Soller 97cdf7da2e Merge branch 'netinetin-trailer' into 'master'
add include guard to cbindgen trailer for netinet_in

See merge request redox-os/relibc!1229
2026-04-27 06:55:33 -06:00
Jeremy Soller 4f4e535e18 Merge branch 'netdb-trailer' into 'master'
add include guard to netdb cbindgen trailer

See merge request redox-os/relibc!1228
2026-04-27 06:55:16 -06:00
auronandace bed9717f6a disambiguate sys_uio include guard 2026-04-27 12:21:32 +01:00
auronandace b50262b76a verify string header includes 2026-04-27 11:20:59 +01:00
auronandace fad0f5b751 change trailer to after_includes for sys_resource 2026-04-27 10:40:49 +01:00
auronandace 522d88a587 add include guard to cbindgen trailer for netinet_in 2026-04-27 09:15:17 +01:00
auronandace 1544554ceb add include guard to netdb cbindgen trailer 2026-04-27 08:51:26 +01:00
auronandace 16e85bab8b move some constants from cbindgen to Rust in dirent 2026-04-27 08:06:45 +01:00
auronandace 8dc8c05e4d fix sys_wait trailer and include guard 2026-04-25 08:39:53 +01:00
Jeremy Soller 02229def9b Merge branch 'add-file-back' into 'master'
fix libiconv compilation

See merge request redox-os/relibc!1224
2026-04-24 07:00:53 -06:00
Jeremy Soller 54d16f7a65 Merge branch 'remove-allowed-unused-imports' into 'master'
remove unused imports and #[allow(unused_imports)] annotations

See merge request redox-os/relibc!1223
2026-04-24 07:00:04 -06:00
auronandace e5451510fc fix libiconv compilation 2026-04-24 12:06:43 +01:00
sourceturner 8daf17e4f7 remove unused imports and #[allow(unused_imports)] annotations 2026-04-23 21:41:24 +02:00
Connor-GH 313f2be0f8 Pal: Add default method impls and remove duplicated code
I noticed that the Linux and Redox PALs both do very similar things for
a given FS function and its *at variant. For example, `mkdir()` is just
a call to `mkdirat()`. POSIX requires these to be equivalent.
Additionally, we use AT_EMPTY_PATH in some places but note that this is
not POSIX and is instead an extension that Linux (and Redox) implement.
That doesn't really matter though, since this is an implementation
detail. Implementations can choose to implement these functions anyway
and ignore the default impl. Such a case is `fstat`, because the current
Redox impl of `fstatat` relies on `fstat`, and this would cause infinite
recursion.

Future work:

POSIX says that `fcntl(fd, F_DUPFD, 0);` shall be equivalent to
`dup(fd);`. `dup2` might have cases where it can be implemented using
`dup3`. `dup` seemingly cannot be implemented in terms of `dup2`, so the
`fcntl` default implementation is sufficient. `pipe(fds)` is equivalent to
`pipe2(fds, 0);`.
2026-04-23 14:18:04 -05:00
Jeremy Soller 4ec5b2c37b Merge branch 'systypes-internals' into 'master'
move internal types from C to rust

See merge request redox-os/relibc!1221
2026-04-23 09:10:51 -06:00
auronandace e15e7cafdb cargo fmt 2026-04-23 11:21:45 +01:00
auronandace e7f311c2c4 move internal types from C to rust 2026-04-23 11:18:14 +01:00
sourceturner ef46ff8746 rename RTLDState enum members 2026-04-22 21:58:02 +02:00