Also, make makedev function safe and const on all platforms.
On Android, change the arguments from signed to unsigned integers to
match the other platforms. The C makedev is a macro, so the
signededness is undefined.
Add an integration test for makedev, too, since it's a macro that we
must reimplement.
linux: add rtnetlink mcast group definitions
These come in two flavors:
- RTNLGRP_* are bit indexes (arguments to setsockopt(2)) as used
in the kernel with test_bit() but also userspace (see libnl
examples).
- RTMGRP_* are bitmasks not used in the kernel; their use
seems to be deprecated, at least according to comments in
libnl, but documentation still references them.
The rationale for adding these definitions is that they're needed
to subscribe to kernel events via Netlink multicast groups.
These come in two flavors:
- RTNLGRP_* are bit indexes (arguments to setsockopt(2)) as used
in the kernel with test_bit() but also userspace (see libnl
examples).
- RTMGRP_* are bitmasks not used in the kernel; their use
seems to be deprecated, at least according to comments in
libnl, but documentation still references them.
The rationale for adding these definitions is that they're needed
to subscribe to kernel events via Netlink multicast groups.
Add musl's lib folder to library search path
Prior to this change, `libc.a` was being found in rustc's self-contained
musl target folder instead of the `libc.a` that we've built or
downloaded. This doesn't seem to have caused any noticeable issues as the
versions of musl we built/installed and the version shipped in rustc's
target matched exactly.
To resolve this, we pass the path to our version of musl's lib folder
directly as a `RUSTFLAG` which causes it to be found first.
Prior to this change, `libc.a` was being found in rustc's self-contained
musl target folder instead of the `libc.a` that we've built or
downloaded. This doesn't seem to have caused any noticeable issues as the
versions of musl we built/installed and the version shipped in rustc's
target matched exactly.
To resolve this, we pass the path to our version of musl's lib folder
directly as a `RUSTFLAG` which causes it to be found first.
Upgrade Ubuntu image on GHA to 22.04
This updates Ubuntu image on GHA to 22.04.
Note that this doesn't update images on Docker so I expect the effect is relatively small.
r? `@ghost`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
linux: add missing netfilter definitions
Bring ``libc`` up to parity with Linux v5.18 headers wrt. to Netfilter.
``libc-test`` fails due to unrelated issues on my Fedora box but the
changes should be inocuous enough IMO.
Note there’s a warning in the code indicating potential trouble due to [this
issue](https://github.com/rust-lang/libc/pull/1628). I’ll sort this out if
the CI run fails.
Add `confstr` and guaranteed `_CS_*` constants on apple
I actually just want `_CS_DARWIN_USER_TEMP_DIR`, and the `confstr` function, but I also have added the other "guaranteed" `_CS_*` values (e.g. present in the [output of `man confstr`](https://gist.github.com/thomcc/12a27c7998019b6da9fa4b539bdbca44)).
This is apparently a [POSIX API](https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html) but I have no idea which other platforms support it, nor what values should be provided. It's somewhat important on Darwin (the only way to access the user temp dir), but I'm not sure what other use it has, so I've only provided it on Darwin.
There are a few other constants in Darwin `unistd.h`, but they're omitted since they're only conditionally present, and they provide values that... don't actually work[^1]. As a result, I've only provided the ones documented by `confstr` documentation.
[^1]: For example, `_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS` nominally provides values that can be passed to a c compiler, but it gives `-W 64` for me, which does not seem to work with `clang`.
apple SEEK_{DATA,HOLE} O_{EVTONLY,NOFOLLOW_ANY}
Checked values in MacOSX12.3.sdk and iPhoneOS15.5.sdk
/usr/include/sys/_types/_seek_set.h
/usr/include/sys/fcntl.h
Also updated representation format by following Apple's form and order
Checked values in MacOSX12.3.sdk and iPhoneOS15.5.sdk
/usr/include/sys/_types/_seek_set.h
/usr/include/sys/fcntl.h
Also updated representation format by following Apple's form and order