summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move structs to `s_no_extra_traits`Yuki Okushi2021-01-071-21/+23
|
* Define some consts on 1.25 ot higherYuki Okushi2021-01-071-1/+1
|
* Define basic Linux SocketCAN constants and typesDamian Jarek2021-01-072-0/+102
| | | | | | | Add definitions from `linux/can.h`, which is a "base" header for remainder of SocketCAN functionality. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
* Auto merge of #2020 - joshtriplett:ifla, r=JohnTitorbors2021-01-051-0/+17
|\ | | | | | | Add more IFLA_ values
| * Add more IFLA_ valuesJosh Triplett2021-01-051-0/+17
| |
* | Auto merge of #2008 - bsteinb:macos-aarch64-mcontext, r=JohnTitorbors2021-01-059-130/+188
|\ \ | |/ |/| | | | | | | | | | | Make test suite pass on macOS on aarch64 While working on #2007 I tried to run `cargo test` in `libc-test`, which failed, because the definition of `__darwin_mcontext64` was incomplete (see #1990). This adds definitions for the exception state and the floating point state as well. `libc-test` still does not pass, because I use the type `[u128; 32]` for the `__v` field of `__darwin_arm_neon_state64` (in C it is `__uint128_t __v[32]`. `ctest2` does not translate `u128` to `__uint128_t` and the generated C code does not compile. Any ideas for working around this?
| * move declarations of mcontext_t and ucontext_tBenedikt Steinbusch2021-01-053-10/+21
| |
| * fix glob symbol name on macOS aarch64Benedikt Steinbusch2021-01-011-1/+4
| |
| * add new constants for macOS Big SurBenedikt Steinbusch2021-01-011-1/+3
| |
| * fix values of constants on macOS aarch64Benedikt Steinbusch2021-01-011-0/+6
| |
| * add declaration of max_align_t for macOS on aarch64Benedikt Steinbusch2021-01-014-7/+21
| |
| * provide declaration of boolean_t for macOS on aarch64Benedikt Steinbusch2021-01-013-1/+4
| |
| * move declaration of __darwin_mcontext64 etc. into align.rsBenedikt Steinbusch2021-01-012-0/+6
| |
| * use [u64; 2] with manual alignment instead of u128Benedikt Steinbusch2021-01-011-1/+2
| |
| * provide complete definition of __darwin_mcontext64 on aarch64Benedikt Steinbusch2021-01-013-66/+78
| |
* | Auto merge of #2019 - kolapapa:mipsel-uclibc, r=JohnTitorbors2021-01-051-0/+2
|\ \ | | | | | | | | | Add EPOLLEXCLUSIVE && EPOLLWAKEUP
| * | Add EPOLLEXCLUSIVE && EPOLLWAKEUPkolapapa2021-01-041-0/+2
| |/
* | aio functions do not require librt on FreeBSDAlan Somers2021-01-033-17/+40
|/ | | | | | | | | | | | | | 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 8c23f77704d4749f5f137c92a048e22fea9d385e from PR #1630 . While I'm here, fix the linkage of lio_listio on DragonflyBSD. It _does_ require librt.
* Auto merge of #2013 - Thomasdezeeuw:freebsd-constants, r=JohnTitorbors2020-12-291-1/+3
|\ | | | | | | Add SO_DOMAIN constants to FreeBSD
| * Add SO_DOMAIN constant to FreeBSDThomas de Zeeuw2020-12-291-1/+3
| |
* | Auto merge of #2011 - tamird:ip-freebind, r=JohnTitorbors2020-12-291-3/+6
|\ \ | | | | | | | | | | | | | | | Define IP_FREEBIND for Fuchsia https://cs.opensource.google/fuchsia/fuchsia/+/master:zircon/third_party/ulib/musl/include/netinet/in.h;l=196;drc=bdf60afa9193c8a9190ee6bb6b5a0a11ad8876b6
| * | Define IP_FREEBIND for FuchsiaTamir Duberstein2020-12-261-3/+6
| |/ | | | | | | https://cs.opensource.google/fuchsia/fuchsia/+/master:zircon/third_party/ulib/musl/include/netinet/in.h;l=196;drc=bdf60afa9193c8a9190ee6bb6b5a0a11ad8876b6
* | Auto merge of #2010 - tamird:if-namsiz, r=JohnTitorbors2020-12-281-0/+1
|\ \ | | | | | | | | | | | | | | | Define IFNAMSIZ for Fuchsia https://cs.opensource.google/fuchsia/fuchsia/+/master:zircon/third_party/ulib/musl/include/net/if.h;l=72;drc=bdf60afa9193c8a9190ee6bb6b5a0a11ad8876b6
| * | Define IFNAMSIZ for FuchsiaTamir Duberstein2020-12-261-0/+1
| |/ | | | | | | https://cs.opensource.google/fuchsia/fuchsia/+/master:zircon/third_party/ulib/musl/include/net/if.h;l=72;drc=bdf60afa9193c8a9190ee6bb6b5a0a11ad8876b6
* | Auto merge of #2007 - bsteinb:macos-aarch64-symbols, r=JohnTitorbors2020-12-281-3/+9
|\ \ | |/ |/| | | | | | | Fix symbols names on macOS aarch64 libSystem on macOS Big Sur on aarch64 exports these symbols without the `$suffix`es. See also: https://github.com/GuillaumeGomez/sysinfo/issues/372
| * fix symbols names on macOS aarch64Benedikt Steinbusch2020-12-231-3/+9
| |
* | Auto merge of #2004 - dylni:define-cld-constants-for-more-targets, r=JohnTitorbors2020-12-244-0/+28
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Define CLD_ constants for more targets This is an extension of #1860 to support more targets. The values for these constants should be correct, but I'm not familiar with most of the targets, so they should be verified. These files should define the constants too, but the targets are closed source, so I don't know their values: - [src/unix/solarish/mod.rs](https://github.com/rust-lang/libc/blob/master/src/unix/solarish/mod.rs) - [src/vxworks/mod.rs](https://github.com/rust-lang/libc/blob/master/src/vxworks/mod.rs)
| * | Define CLD_ constants for more targetsdylni2020-12-214-0/+28
| |/
* | Add ip_mreqn for FuchsiaSam Balana2020-12-211-0/+6
|/ | | | | | Adds the ip_mreqn struct for the Fuchsia platform, as defined by ip(7). Enables joining an IPv4 multicast group by NIC ID rather than by its assigned IPv4 address.
* Auto merge of #1999 - Jakob-Naucke:fix-statfs-magic-s390x, r=JohnTitorbors2020-12-211-50/+105
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare statfs MAGIC constants as c_uint on s390x Hi, I work in container development on Linux on Z at IBM. On s390x (IBM Z) in GNU/Linux, a statfs `f_type` is 4 bytes wide, contrary to 8 bytes on most architectures. This is already implemented in libc: ```sh $ grep -r f_type src/unix/linux_like/linux/gnu/b64 | uniq src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs: pub f_type: ::__fsword_t, src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs: pub f_type: ::__fsword_t, src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs: pub f_type: ::__fsword_t, src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs: pub f_type: ::c_long, src/unix/linux_like/linux/gnu/b64/mips64/mod.rs: pub f_type: ::c_long, src/unix/linux_like/linux/gnu/b64/s390x.rs: pub f_type: ::c_uint, # s390x is uint src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs: pub f_type: ::__fsword_t, ``` However, the `*_MAGIC` constants (such as `EXT4_SUPER_MAGIC`) in `src/unix/linux_like/linux/gnu/mod.rs` are defined as `c_long`, when they should be `c_uint` on s390x. This ends up biting me [here](https://github.com/kata-containers/cgroups-rs/blob/master/src/hierarchies.rs#L231). Thus, I suggest the attached change to only define these constants for architectures other than s390x and instead define them as uint for s390x. This is safe since none of the constants are any wider than 32bit. Please let me know if you think this could be done more elegantly.
| * Declare statfs MAGIC constants as c_uint on s390xJakob Naucke2020-12-211-50/+105
| | | | | | | | | | | | | | | | | | Previously, statfs MAGIC constants like EXT4_SUPER_MAGIC were defined as c_long for linux-gnu, whereas a statfs f_type is a c_uint on s390x. This commit exempts these definitions from s390x and instead defines these constants as c_uint on s390x. This is safe as none of these constants are wider than 32bit. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
* | Populate mcontext_t on aarch64-linux-muslLuca Barbato2020-12-191-5/+7
|/ | | | It is used by wasmtime.
* Auto merge of #1998 - dylni:make-si-status-method-more-compatible, r=JohnTitorbors2020-12-174-0/+16
|\ | | | | | | | | | | | | | | Make si_status method more compatible Now that [this PR](https://github.com/rust-lang/libc/pull/1858/files) has been merged, `siginfo_t::si_status` is a method for some targets and a field on others. This PR adds the method on targets that already expose the field, which lets the method be used without target detection. I think this change is backward compatible, but it would be better if someone else could confirm that. The struct would now have a method and a field with the same name on some targets. If that's incompatible, another method could be added that accesses the field or calls the method depending on the target, but this is cleaner.
| * Make si_status method more compatibledylni2020-12-174-0/+16
| |
* | Auto merge of #1992 - victorhsieh:master, r=JohnTitorbors2020-12-172-2/+2
|\ \ | |/ |/| | | | | | | | | | | Android: make statfs64.f_fsid public This has been the case since the initial commit a36da11fb9cfcafcee6cb263bf1dc2c84371730a. But there is no reason to hide this struct member specifically.
| * Android: correct statfs64.f_fsid type & visibilityVictor Hsieh2020-12-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | The visibility has been not public since the initial commit[1]. But there is no reason to hide this struct member specifically. The type has also been "__fsid_t" in Android's bionic[2], so fix that as well. This makes it consistent with statfs.f_fsid nicely. [1] a36da11fb9cfcafcee6cb263bf1dc2c84371730a [2] https://cs.android.com/search?q=file:bionic%2Flibc%20f_fsid
* | Auto merge of #1990 - JohnTitor:arm-macos-state64, r=JohnTitorbors2020-12-123-30/+60
|\ \ | | | | | | | | | | | | | | | Fix `thread_state64` on `aarch64-apple-darwin` Fixes #1977
| * | Fix `thread_state64` on `aarch64-apple-darwin`Yuki Okushi2020-12-073-30/+60
| |/
* | Declare `O_RSYNC` for Android.whitequark2020-12-121-0/+1
| | | | | | Bionic defines it to be `O_SYNC`.
* | Declare `seekdir` and `telldir` for Android.whitequark2020-12-121-0/+2
| | | | | | These declarations are the same as those for other platforms.
* | restore the type of the parameter flags of getnameinfo to c_intkolapapa2020-12-101-1/+1
| |
* | Add the Aarch64 HWCAP_ values for AndroidJack Lloyd2020-12-071-0/+43
| |
* | Add getauxval for 64-bit AndroidJack Lloyd2020-12-071-0/+29
|/
* Address review comments.David Craven2020-12-037-108/+18
|
* Followup to #1649.David Craven2020-12-031-0/+18
|
* Auto merge of #1982 - Thomasdezeeuw:freebsd-getrandom, r=JohnTitorbors2020-11-271-0/+10
|\ | | | | | | | | | | | | | | | | | | Add getrandom to FreeBSD Introduced in FreeBSD 12.0. Manual page: https://www.freebsd.org/cgi/man.cgi?query=getrandom. Not sure if the constants should be `c_int`, just matching the `flags` argument in the function, in c they're macros.
| * Add getrandom to FreeBSDThomas de Zeeuw2020-11-241-0/+10
| | | | | | | | | | | | Introduced in FreeBSD 12.0. Manual page: https://www.freebsd.org/cgi/man.cgi?query=getrandom.
* | add missing TCP socket options for illumosJoshua M. Clulow2020-11-252-1/+19
| | | | | | | | | | The socket2 crate now depends on TCP_MAXSEG, and the rest of the options may as well come along for the ride.
* | Auto merge of #1979 - kolapapa:uclibc-dnslookup, r=JohnTitorbors2020-11-251-0/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | add `getnameinfo` && `EAI_NODATA` in uclibc when compiling `dns-lookup v1.0.5` in target `mipsel-unknown-linux-uclibc` ```shell error[E0432]: unresolved import `libc::getnameinfo` error[E0531]: cannot find unit struct, unit variant or constant `EAI_NODATA` in crate `c` ```
| * | Update src/unix/uclibc/mod.rs kolapapa2020-11-231-1/+1
| | | | | | | | | | | | | | | change `getnameinfo` flags type to `c_uint` Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>