summaryrefslogtreecommitdiff
path: root/src/unix/uclibc/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #1365 - gnzlbg:cleanup_linux, r=gnzlbgbors2019-05-281-0/+2
|\ | | | | | | | | | | | | | | | | | | | | [breaking change] Cleanup linux and update MUSL * Update MUSL kernel headers to 4.4.2 (non-breaking) * [breaking] `MADV_SOFT_OFFLINE` is not defined on MIPS * [breaking] `sendmmsg`/`recvmmsg` take an `unsigned int` flag on MUSL * [breaking] `pthread_t` is a pointer on MUSL * `rlimit` resources should use a type alias on GNU (non-breaking) * Deprecate `SIGNUNUSED` (should use SIGSYS instead)
| * Update MUSL Linux kernel headers and re-enable Linux testsgnzlbg2019-05-271-0/+2
| |
* | Ignore padding for `sockaddr_nl` structBryant Mairs2019-05-271-7/+32
| | | | | | | | | | | | `nl_pad` field does not contain any actual data, so using it for comparison or hashing doesn't make sense. Instead manually implement extra traits ignoring this field.
* | Ignore padding for mq_attrBryant Mairs2019-05-271-8/+40
|/ | | | | | | 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.
* Test strerror_r on Android and Linuxgnzlbg2019-05-231-0/+5
|
* [breaking change] incorrect API of gettimeofdaygnzlbg2019-05-221-0/+2
| | | | | | | | | | | | | | | | | | | | | 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&section=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.
* Fix getgrgid_r to accept gid_t.Charles Lew2019-04-291-1/+1
|
* Fix uclibc build errorsgnzlbg2019-03-031-39/+45
|
* Auto merge of #1288 - red75prime:pr-uclibc-arm, r=gnzlbgbors2019-03-011-0/+3
|\ | | | | | | | | | | Add arm-uclibc definitions I used `buildroot-2017.05` to build armv7 cross compiler, `uclibc-1.0.24` and `libc-test`. I've executed `libc-test` on armv7-based SoC, using modified `libc-test` to account for the environment. Modified libc-test is not included in this PR because it is too dependent on cross compilation and execution environment.
| * Add arm-uclibc definitionsred75prime2019-02-281-0/+3
| |
* | Clean libc-test for apple targetsgnzlbg2019-02-221-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up the build.rs of `libc-test` for apple targets. I wanted to update the docker containers of some targets so that we can start testing newer currently-skipped APIs properly, but it is impossible to figure out which headers and APIs are skipped for each target. This PR separates the testing of apple targets into its own self-contained function. This allows seeing exactly which headers are included, and which items are skipped. A lot of work will be required to separate the testing of all major platforms and make the script reasonable. During the clean up, I discovered that, at least for apple targets, deprecated but not removed APIs are not tested. I re-enabled testing for those, and fixed `daemon`, which was not properly linking its symbol. I also added the `#[deprecated]` attribute to the `#[deprecated]` APIs of the apple targets. The attribute is available since Rust 1.9.0 and the min. Rust version we support is Rust 1.13.0. Many other APIs are also currently not tested "because they are weird" which I interpret as "the test failed for an unknown reason", as a consequence: * the signatures of execv, execve, and execvp are incorrect (see https://github.com/rust-lang/libc/issues/1272) * the `sig_t` type is called `sighandler_t` in libc for some reason: https://github.com/rust-lang/libc/issues/1273 This probably explains why some other things, like the `sa_handler`/`sa_sigaction` fields of `sigaction` were skipped. The field is actually a union, which can be either a `sig_t` for the `sa_handler` field, or some other type for the `sa_sigaction` field, but because the distinction was not made, the field was not checked. The latest ctest version can check volatile pointers, so a couple of skipped tests are now tested using this feature.
* Cleanup dox messgnzlbg2019-02-131-16/+16
|
* Fix build on all platformsgnzlbg2019-02-071-100/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 .
* Check for Copy impls for all typesBryant Mairs2019-02-021-0/+8
|
* Check for Debug impls for all typesBryant Mairs2019-02-021-0/+2
| | | | | This was not compile-tested on all platforms, but instead all `pub enum` types had a `Debug` impl derived for them.
* Fix uname on FreeBSDAlan Somers2019-01-031-0/+1
| | | | | | | | | On FreeBSD, uname is an inline function. The uname that is present in libc.so is for FreeBSD 1.0 compatibility. It expects a buffer of a different size. Fixes #1190 Reported-by: Alex Zepeda
* Auto merge of #1129 - gnzlbg:sgx, r=gnzlbgbors2018-11-211-0/+6
|\ | | | | | | | | | | Add SGX C types cc @jethrogb
| * splice the common libc functions and ctypes throughout the librarygnzlbg2018-11-211-0/+6
| |
* | Add missing condition for musl mips64Mike Hommey2018-11-211-1/+1
|/ | | | | unix::uclibc::mips has both support for mips and mips64, but it's currently only imported for mips.
* Add support for SIGSYS in signalfdStephen Barber2018-11-061-1/+6
| | | | | | | | Linux 4.18 added support for SIGSYS info in signalfd. Add the new fields to signalfd_siginfo. While the kernel has support for these new fields now, no libc has shipped a release with the new signalfd fields.
* uClibc: add missing fd exportsjhwgh19682018-09-081-0/+4
|
* Add align feature to pthread structsLinus Färnstrand2018-07-291-23/+72
|
* add fdopendir on macOSScott Lamb2018-06-071-2/+0
| | | | | | | | | | | | | | | | | | | Fixes #1017 I moved it up to src/unix/mod.rs, as it's specified in POSIX.1-2008 and appears to be implemented on every Unix-like system. The symbol names on macOS appear similar to those for opendir; I found them via the commands below. I tested the x86_64 version; fdopendir$INODE64 worked as expected. $ nm -arch x86_64 /usr/lib/system/libsystem_c.dylib | grep fdopendir 000000000007ea6d T _fdopendir 000000000002ba97 T _fdopendir$INODE64 $ nm -arch i386 /usr/lib/system/libsystem_c.dylib | grep fdopendir 00082d1e T _fdopendir 0002b528 T _fdopendir$INODE64$UNIX2003 00082d1e T _fdopendir$UNIX2003
* Add sem_getvalue to unixJason Longshore2018-05-101-0/+2
|
* Fix libstd build for mips*-unknown-linux-uclibcdragan.mladjenovic2018-04-031-0/+3
|
* redefine pthread_t for l4re-uclibcSebastian Humenda2018-03-121-1/+0
|
* Syntax fixKelvin Ly2017-11-141-2/+2
|
* Add some fixes to allow it to compile with newer libstdKelvin Ly2017-11-141-0/+2
|
* FIX: line longer than 80 charsluozijun2017-11-091-1/+2
|
* Add network interface flag constants for all platformsluozijun2017-11-091-16/+18
| | | | Add network interface flag constants for all platforms.
* Move various POLL* and RTLD_LAZY constants into submodules.Jessica Hamilton2017-09-261-0/+8
| | | | | Unfortunately, these differ on Haiku, and using #[cfg(...)] is not allowed in unix/mod.rs.
* Define additional IPPROTO_* constants.Jack Pappas2017-09-171-0/+56
|
* Add networking symbols for uclibc/x86_64Sebastian Humenda2017-09-061-0/+5
|
* Add QCMD() for available platformsBryant Mairs2017-08-291-0/+4
|
* Add asmjs/wasm32 to CIAlex Crichton2017-08-261-14/+69
| | | | | | | | Rebase of #610 and also move emscripten up much higher in the hierarchy to ensure that it doesn't have too much of a ripple effect on other platforms. This involved moving down a good number of definitions, but hopefully was done with care to not break anything!
* Move endpwent out of the base Unix moduleJamie Hewland2017-08-101-0/+1
| | | | | * Doesn't do much without getpwent/setpwent * Not supported on Android before Android O
* Try move getpwuid_r/getpwnam_r to base Unix moduleJamie Hewland2017-08-101-10/+0
|
* Merge branch 'master' of https://github.com/rust-lang/libcKelvin Ly2017-07-311-7/+17
|\
| * add missing socket constantsNicolas Dusart2017-07-101-6/+0
| |
| * Add pthread_rwlockattr APIsmain()2017-06-281-0/+13
| |
| * Add x86_64 module to uclibc/mod.rsSebastian Humenda2017-06-041-0/+3
| |
| * Add experimental L4re supportSebastian Humenda2017-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This commit introduces a UNIX-alike target for the l4re microkernel operating system. While this system is not a UNIX system at all, it is easiest to use the POSIX interface and hence benefit from common definitions. This version is a very early draft, only the basic data types have been verified and most of the complex data types (structs and unions) have not been ported yet.
* | Add IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP to uclibcKelvin Ly2017-07-311-0/+3
|/
* Remove mips64-linux-uclibc as a targetKelvin Ly2017-04-301-2/+1
|
* Remove unsupported targetsKelvin Ly2017-04-301-5/+1
|
* Fix more styleKelvin Ly2017-04-241-238/+236
|
* Style fixesKelvin Ly2017-04-241-279/+272
|
* Restructure with separate uclibc branchKelvin Ly2017-04-241-0/+1780