In particular:
Add timerfd constants and functions, from sys/timerfd.h.
Add EFD_SEMAPHORE and group all EFD_ constants together.
Add sigtimedwait function, from signal.h.
Add missing fallocate constants and functions, from linux/falloc.h and fcntl.h.
Add xattr functions, from sys/xattr.h.
Add SCHED_ and SEEK_ constants, from linux/sched.h and bits/seek_constants.h.
Add rlimit functions, from sys/resource.h.
Add RENAME_ constants, from stdio.h.
Add ino64_t type, from sys/types.h.
This patchs adds missing flag values for getnameinfo()
on FreeBSD, the following flags have been added from
the FreeBSD tree.
/*
* Flag values for getnameinfo()
*/
#define NI_NOFQDN 0x00000001
#define NI_NUMERICHOST 0x00000002
#define NI_NAMEREQD 0x00000004
#define NI_NUMERICSERV 0x00000008
#define NI_DGRAM 0x00000010
#define NI_NUMERICSCOPE 0x00000020
Signed-off-by: Valdemar Erk <valdemar@erk.io>
The `fanotify` API[0] is a linux-specific API for notification and interception
of filesystem events. In some ways it is similar to `inotify`, but with
different advantages/tradeoffs. It is particularly well suited to full
filesystem/mount monitoring (vs per directory) and for allowing/denying access
to files (`inotify` lacks this capability).
The `fanotify` API has been updated several times since it was enabled in Linux
2.6.37. Presently I've only included support for the original `fanotify`
features, and the `FAN_MARK_FILESYSTEM` addition made in Linux 4.20. There are
subsequent updates in 5.0 and 5.1 not covered in this initial commit.
This commit adds the relevant constants and types from
`uapi/linux/fanotify.h`[1] and two new functions (`fanotify_init`[2] and
`fanotify_wrap`[3]) to `src/unix/linux_like/linux/mod.rs`. While I believe this
API is also present on Android I have presently limited my attention to Linux.
Although this commit focuses on Linux 4.20.x's `fanotify` API/constants I have
skipped adding constants for `FAN_ALL_CLASS_BITS`, `FAN_ALL_INIT_FLAGS`,
`FAN_ALL_MARK_FLAGS`, `FAN_ALL_EVENTS`, `FAN_ALL_PERM_EVENTS` and
`FAN_ALL_OUTGOING_EVENTS` even though they are present in this kernel version's
headers. These defines were deprecated[4] in later releases with instructions to
not use them in new programs or extend them with new values. It would be a shame
for new Rust programs to use deprecated #defines!
[0]: http://man7.org/linux/man-pages/man7/fanotify.7.html
[1]: d54f4fba88/include/uapi/linux/fanotify.h
[2]: http://man7.org/linux/man-pages/man2/fanotify_init.2.html
[3]: http://man7.org/linux/man-pages/man2/fanotify_mark.2.html
[4]: 23c9deeb32 (diff-4c9ca62be6bf38cc08f7ea9daf16e379)
Add sock_extended_err and associated constants from errqueue.h to linux_like
This is an alternate version of #1614 that attempts to fix issues with the android ctests by rearranging the headers. Due to long CI cycle time, I've opened it as an alternate PR. Only one or the other should merge, depending if linux_like or linux is the correct place for this.
sock_extended_err is a struct returned as a control message when the sockopt
IP_RECVERR is set, when recvmsg has the MSG_ERRQUEUE flag set. IP_RECVERR and
MSG_ERRQUEUE are constants both already defined here.
This commit performs a number of updates for libc with the `wasm32-wasi`
target:
* Updates the `wasi-libc` repository commit used (previously known as
`wasi-sysroot`)
* Updates the container to Ubuntu 19.10 which has Clang 9 packaged which
is all we need.
* Avoids building `wasmtime` and instead downloads a precompiled binary.
* Updates bindings in `src/wasi.rs` to match the current upstream state.
sock_extended_err is a struct returned as a control message when the sockopt
IP_RECVERR is set, when recvmsg has the MSG_ERRQUEUE flag set. IP_RECVERR and
MSG_ERRQUEUE are constants both already defined here.
This moves the linux/ headers after others
This keeps the Android tests closer to the Linux ones.
I think this is needed to get linux/errqueue.h to not cause compilation
failures.
Add flock64 to linux_like platforms
Hi,
I'm not sure about what to make of the ifdef in glibc `__USE_LARGEFILE64` that covers it.
but I copied the impl from glibc's headers.
everything is the same except for sparc which has a reserved short int.
and in musl it's just `#define flock64 flock`
Upgrade to musl 1.1.24 in CI
Required by #1577
Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](13d4a5da2e/src/unix/linux_like/mod.rs (L97)) are outdated. I'm not sure if we should rename them, since they are in public API.
I simply skip `struct sched_param` from the test now.
Here's the diff between musl 1.1.23 and 1.1.24
```
diff --git a/include/sched.h b/include/sched.h
index 05d40b1e..7e470d3a 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -18,10 +18,12 @@ extern "C" {
struct sched_param {
int sched_priority;
- int sched_ss_low_priority;
- struct timespec sched_ss_repl_period;
- struct timespec sched_ss_init_budget;
- int sched_ss_max_repl;
+ int __reserved1;
+ struct {
+ time_t __reserved1;
+ long __reserved2;
+ } __reserved2[2];
+ int __reserved3;
};
```