And while here, simplify the code to use `println!` to print "hello
world", which we can do now that it's no longer running within the
test harness process.
On arm, use the `64`-suffixed symbol so that the optimized path only
uses the y2038-safe version.
On risc-v, use the symbol name from the actual kernel code.
And on arm and x86, handle the case where the y2038-safe symbol is not
present.
* Update to linux-raw 0.0.39.
This version drops support for multiple Linux API versions, so this drops
all the `v5_4::` and `v5_11::` qualifiers.
* Implement fallback for old-style socket timeouts.
Linux socket timeout options moved from y2038-unsafe `timeval` to
y2038-safe `__kernel_timespec`. Optimistically use the new options
first, and implement fallback code to use the old versions if
needed.
* Update to linux-raw-sys 0.0.40, which fixes the riscv64 issues.
* Use `__NR_ugetrlimit` on architectures which have it.
* Factor convertions to/from `Duration` into helper functions.
Move all the safety checks out of `init_from_sysinfo_ehdr` and into a
helper function. This makes `init_from_sysinfo_ehdr` less huge and
clarifies the split between the safety checks and the actual vDSO
parsing code.
Remove lines like
> pub(crate) use super::fs::syscalls::*;
from the top-level syscalls.rs files, and just have code reference the
specific modules they need.
In the few places where rustix has fallback code for handling `NOSYS`
errors, split the fallback code into separate functions, so that the
main flow of the code is easier to follow.
Implement `fcntl_add_seals`, and add a `SealFlags` to describe seal flag
values in `fcntl_add_seals` and `fcntl_get_seals`.
Also, add `MFD_HUGETLB` and accompanying flag values.
The existing CI code checked it for --release builds; this ensures it's
checked for debug builds as well.
This also updates the debug builds which became out of date after
f7e4c56d added comments to the .s files, changing the line numbers in
the .debug_line sections.
I typically develop inside a https://github.com/containers/toolbox/
container. In this scenario:
```
$ ls -ald /proc
dr-xr-xr-x. 526 nobody nobody 0 Jan 12 14:47 /proc
$
```
And that's expected and normal; the real root uid from outside
the user namespace is mapped to `nobody`; distinct from the uid 0
inside the userns.
Honestly, I am still somewhat skeptical of the value of all of
these checks. We're already validating that `/proc`'s filesystem
magic is `PROC_SUPER_MAGIC` - that seems really more than sufficient.
This is a best practice to be friendly to users who may want
to add things to their own structs and want to simply `#[derive(Debug)]`
and I'm assuming its omission was accidental.
At least as far as I can tell, the Linux btrfs code does not
set `f_files`. I think likely because inode allocations are fully
dynamic.
Testing the block count should be sufficient.
The atty crate doesn't support operating on arbitrary streams, and uses
a `Stream` enum which requires it to access stdio streams implicitly.
Begin migrating to a new is-terminal crate, which has an API that takes
an `AsFilelike` argument.
The `readlinkat` syscall writes into the output buffer, so it is not
`readonly`, so use a non-`readonly` syscall wrapper for it. I believe
this bug isn't observable outside the crate, due to the restricted
ways that the actual syscall wrapper is used.