| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
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 triggers a warning on a recent nightly, which in turn breaks CI due to
`#![deny(warnings)]` in libc-test/build.rs
|
|\
| |
| |
| |
| |
| | |
Implement utmp for NetBSD
Followed this: https://github.com/NetBSD/src/blob/trunk/include/utmp.h
|
| | |
|
|\ \
| |/
|/|
| | |
use *const pointer for NetBSD's pthread_setname_np
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
initial work from @landryb for OpenBSD, various fixes and NetBSD support from me.
Fixes #1585
|
|/ |
|
| |
|
| |
|
|
|
|
| |
It's *msg_prio* in both manpages and posix.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adding UTIME_NOW and UTIME_OMIT to OSes which support utimensat
I've managed to verify a handful of these:
- [FreeBSD](https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/tools/build/stat.h#L35)
- [NetBSD](https://github.com/NetBSD/src/blob/64b8a48e1288eb3902ed73113d157af50b2ec596/sys/sys/stat.h#L235)
- [Apple](https://opensource.apple.com/source/xnu/xnu-4903.221.2/bsd/sys/stat.h.auto.html)
I'm less confident in these:
- [Haiku](https://github.com/haiku/haiku/blob/abb59d7351c7ddb50c63c40430a82d94fa61917a/headers/posix/sys/stat.h#L105)
- I could be wrong on this one: https://github.com/haiku/haiku/search?q=UTIME_NOW&unscoped_q=UTIME_NOW
- [WASI](https://github.com/CraneStation/wasi-libc/blob/24792713d7e31cf593d7e19b943ef0c3aa26ef63/libc-top-half/musl/include/sys/stat.h#L71)
- I could be wrong on this one: https://github.com/CraneStation/wasi-libc/search?q=UTIME_NOW&unscoped_q=UTIME_NOW
- [Solarish](https://github.com/illumos/illumos-gate/blob/4e0c5eff9af325c80994e9527b7cb8b3a1ffd1d4/usr/src/uts/common/sys/stat.h#L478)
|
| | |
|
|/ |
|
|
|
|
| |
Exposes value for most unix like platforms
|
|
|
|
|
|
|
| |
These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.
Closes rust-lang/libc#665
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add FIONCLEX and other FIO* constants for Linux, DragonFly and OpenBSD
[OpenBSD header](https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/filio.h?annotate=1.5) | [DragonFly header](http://gitweb.dragonflybsd.org/dragonfly.git/blame/refs/heads/master:/sys/sys/filio.h) | [Linux search](https://github.com/torvalds/linux/search?q=FIONCLEX+FIOQSIZE&unscoped_q=FIONCLEX+FIOQSIZE&type=Code)
For Linux I've used [godbolt compiler explorer](https://godbolt.org/z/h-C7qM) to get final values where possible.
Wile this crate has FIOCLEX for Fuchsia, Emscripten and Redox, I've not added FIONCLEX for them because those targets appear to support neither.
I started adding FIOASYNC, FIOSETOWN and FIOGETOWN for all the Linux architectures, but gave up when I realized FIOASYNC is kind of deprecated and the other two useless without more symbols. If anybody is interested I have a [branch with how far I got](https://github.com/tormol/rust-libc/tree/sigio).
|
| |
| |
| |
| |
| |
| | |
* 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
|
|/
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| |
| |
| |
| | |
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 second argument of `gettimeofday` was a `*mut c_void` on all targets,
but that type is incorrect in the following targets, where it should be
a `*mut timezone` instead:
On these other targets it appears that the signature of gettimeofday was incorrect (it takes a time-zone pointer instead of a void pointer):
linux+gnu: http://man7.org/linux/man-pages/man2/gettimeofday.2.html
freebsd: https://www.freebsd.org/cgi/man.cgi?query=gettimeofday&apropos=0&sektion=2&manpath=FreeBSD+11.2-stable&arch=default&format=html
openbsd: https://man.openbsd.org/gettimeofday.2
android: https://github.com/ricardoquesada/android-ndk/blob/master/usr/include/sys/time.h
dragonfly: https://www.dragonflybsd.org/cgi/web-man?command=gettimeofday§ion=2
This commit corrects the type on these targets, which is a breaking change. Due
to how this API is commonly used (e.g. passing `ptr::null_mut` to the second
argument), breakage should be minimal. Users wanting to support both versions
can just write `ptr as *mut _` instead.
Closes #1338.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR fixes the build on all platforms and all Rust version down to the
minimum Rust version supported by libc: Rust 1.13.0.
The `build.rs` is extended with logic to detect the newer Rust features used by
`libc` since Rust 1.13.0:
* Rust 1.19.0: `untagged_unions`. APIs using untagged unions are gated on
`cfg(libc_unions)` and not available on older Rust versions.
* Rust 1.25.0: `repr(align)`. Because `repr(align)` cannot be parsed by older
Rust versions, all uses of `repr(align)` are split into `align.rs` and
`no_align.rs` modules, which are gated on the `cfg(libc_align)` at the top
level. These modules sometimes contain macros that are expanded at the top
level to avoid privacy issues (`pub(crate)` is not available in older Rust
versions). Closes #1242 .
* Rust : `const` `mem::size_of`. These uses are worked around with hardcoded
constants on older Rust versions.
Also, `repr(packed)` structs cannot automatically `derive()` some traits like
`Debug`. These have been moved into `s_no_extra_traits!` and the lint of missing
`Debug` implementations on public items is silenced for these. We can manually
implement the `extra_traits` for these in a follow up PR. This is tracked
in #1243. Also, `extra_traits` does not enable `align` manually anymore.
Since `f64::to_bits` is not available in older Rust versions, its usage
has been replaced with a `transmute` to an `u64` which is what that method
does under the hood.
Closes #1232 .
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix CMSG_DATA(3) and friends on BSD
PR #1098 added the CMSG_DATA(3) family of functions into libc. Because
they're defined as macros in C, they had to be rewritten as Rust
functions for libc. Also, they can't be tested in CI for the same
reason. But that PR erroneously used the same definitions in BSD as in
Linux.
This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD,
OpenBSD, and NetBSD. I renamed a few variables and collapsed a few
macros in order to combine the definitions where possible.
Fixes #1210
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
PR #1098 added the CMSG_DATA(3) family of functions into libc. Because
they're defined as macros in C, they had to be rewritten as Rust
functions for libc. Also, they can't be tested in CI for the same
reason. But that PR erroneously used the same definitions in BSD as in
Linux.
This commit corrects the definitions for OSX, FreeBSD, DragonflyBSD,
OpenBSD, and NetBSD. I renamed a few variables and collapsed a few
macros in order to combine the definitions where possible.
Fixes #1210
|
|\ \
| | |
| | |
| | |
| | |
| | | |
Fix linking aio_read(3) and friends on NetBSD
The aio functions require librt on NetBSD.
|
| |/
| |
| |
| | |
The aio functions require librt on NetBSD.
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
NetBSD 8 adds new address family changing AF_MAX and new ifaddrs flags.
libc-test on NetBSD 8.0 fails without these changes.
ifa_addrflags was added to struct ifaddrs to support AF_CAN.
AF_MAX got bumped up one by AF_CAN.
RT_IFLIST format changed to support ifa_addrflags.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|