Add Redox definitions for net functions
Adds the following function definitions for Redox:
- getpeername
- sendto
- send
- recvfrom
- recv
If it is possible to do a release after merging this, that would be great! These function definitions are required for porting mio and tokio to Redox
add remaining pktinfo consts/structs for the other BSDs
This continues the work from https://github.com/rust-lang/libc/pull/980, adding a more complete set of supported platforms for the "I want to know what destination this UDP packet had" problem.
add pktinfo consts and structs for linux and apple
The constants and structs are from `/usr/include/linux/in.h`, `/usr/include/linux/in6.h` for Linux (+ Android) and `/usr/include/netinet/in.h`, `/usr/include/netinet6/in6.h` for Apple.
With Apple it's important to mention that I'm choosing the RFC 3542 versions of the constants in alignment with other critical pieces of software like [nginx](http://hg.nginx.org/nginx/rev/9fb994513776), and Linux also defaults to this RFC version.
haiku: Add RLIMIT_STACK and fix RTLD_* definitions
This commit adds additional definitions for Haiku which fixes issues in building libc and backtrace-rs when cross-compiling Haiku using docker ci.
Fix undefined-behavior on MacOSX structs in stdbuilds
Some MacOSX structs have an incorrect layout that results in undefined behavior. This is because on `x86_64` the MacOSX kernel headers define these using `#pragma pack 4`.
This PR fixes their layout using `repr(packed(4))` . Since it is only available on nightly, it is only enabled for stdbuilds .
Make netlink struct fields public
I realized my netlink structs were a bit unusable if their fields are not public 🤦♂️
Follow up and improvement to #922
Add PTHREAD_*_MUTEX_INITIALIZER_NP for glibc
`pthread_mutex_t` varies across architectures, in several ways:
- endianness alters the ordering of bytes, since the contents of the
struct are larger than 8-bit.
- its length varies.
- the location of the mutex kind (`PTHREAD_MUTEX_RECURSIVE`,
`PTHREAD_MUTEX_ERRORCHECK` or `PTHREAD_MUTEX_ADAPTIVE_NP`) varies
between 32-bit and 64-bit: On 32-bit architectures, it is preceded by
three int/unsigned int, while on 64-bit architectures, it is preceded
by four of them.
These initializers are only available from <pthread.h> when _GNU_SOURCE
is defined.
`pthread_mutex_t` varies across architectures, in several ways:
- endianness alters the ordering of bytes, since the contents of the
struct are larger than 8-bit.
- its length varies.
- the location of the mutex kind (`PTHREAD_MUTEX_RECURSIVE`,
`PTHREAD_MUTEX_ERRORCHECK` or `PTHREAD_MUTEX_ADAPTIVE_NP`) varies
between 32-bit and 64-bit: On 32-bit architectures, it is preceded by
three int/unsigned int, while on 64-bit architectures, it is preceded
by four of them.
These initializers are only available from <pthread.h> when _GNU_SOURCE
is defined.
Relax the cfg_if check in ci/style.rs to allow #[cfg(target_endian)]
tests.