On FreeBSD, the aio_ functions require librt _only_ if they use
SIGEV_THREAD completion notification. However, due to Rust's originally
poor support for C unions, libc doesn't even expose some of the fields of
struct sigevent that SIGEV_THREAD requires. Accordingly, there is no
need to link librt to programs using aio via libc.
This change partially reverts 8c23f77704
from PR #1630 .
While I'm here, fix the linkage of lio_listio on DragonflyBSD. It
_does_ require librt.
The pr #1870 introduced safe_f! macro, which made some functions like
WIFEXITED and WEXITSTATUS const and safe on linux_like platform only,
which causes inconsistency when trying to use those functions in crates
compiled across multiple platforms, as using unsafe on those functions
will generate unused_unsafe warning on linux platforms and lack of
unsafe block will fail compilation on non-linux platforms.
To avoid the inconsistency, this commit applies the same macro for all
the same functions on other platforms too.
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>
memmem is a non-standard extension, first added in GNU libc and later
ported to other systems. Support for it is non-uniform, thus it was only
added to platforms that seem to support it.
This constant is not stable across OS versions, so it cannot be used in
any backwards- or forwards- compatible way. It's typically used to size
arrays in the kernel and in debugging utilities that are closely tied to
the OS version. Since libc is ignorant about OS versions, we shouldn't
even be defining it.
Currently, libc supports and detects freebsd11 and freebsd13
Unknown versions, like freebsd13, is treated as freebsd11.
This patch solve the issues, detecting freebsd13 and treating it like
freebsd12.
Inverting the logic not(freebsd12) -> freebsd11 where possible
sigevent structs on most platforms have padding or unused fields. Rather
than display those in the Debug impl by deriving it, manually implement
all extra_traits instead ignoring those fields.
* Change the type of FIONCLEX on apple platforms from c_uint to c_ulong
* Add FIONCLEX, FIONREAD, FIOASYNC, FIOSETOWN and FIOGETOWN
for DragonFly and OpenBSD
Deprecate fixed width integer type aliases
cc @emilio - I think it makes sense to ensure that the latest released version of bindgen works properly with this change. That is, that even when asked to use C types from, e.g., `libc::`, it does not use aliases for the fixed-width integer C types (e.g. `libc::int64_t`) but uses Rust primitive types instead (e.g. `u64`).
Closes#1304 .
The `pad` or `__reserved` fields are not always 0 on some platforms,
so when used in the `PartialEq` implementation being used, fails some
comparisons. This commit manually implements the extra traits to
correct this behavior.
This commits adds a second FreeBSD 12 build job,
and splits the implementation of the FreeBSD module
into two modules, one for FreeBSD 11, and one for FreeBSD 12.
The FreeBSD 11 module is compiled always by default, and is
mostly forward compatible with FreeBSD 12 systems.
The FreeBSD 12 module is only built for now in libc's CI,
and uses FreeBSD 12 data types and APIs, linking to symbols
that are only available in FreeBSD 12.
Basically, when LIBC_CI env variable is defined, and the host
system is a FreeBSD 12 system, then the FreeBSD 12 module is
automatically built and tested. Conditional compilation is done
using a `cfg(freebsd12)` flag.
This commit also re-enables many tests, and documents why
some remain disabled.
Broader sendmmsg() / recvmmsg() support
As a prerequisite for getting `sendmmsg()` / `recvmmsg()` into nix ( https://github.com/nix-rust/nix/pull/1017 ), support for non-linux platforms needs to be added in libc.
The initial commits in this PR will just be to test out target support via CI.