Add cfmakeraw and cfsetspeed
This includes implementations for Android. `cfsetspeed` is basically just a back-to-back call to `cfsetispeed` and `cfsetospeed`, both of which seem to do the same thing here, so I just copied that body as well for `cfsetspeed`. The implementation for `cfmakeraw` was taken from the man pages for `termios(3)`.
- Copy 17 functions definitions from src/unix/mod.rs
to src/unix/bsd/mod.rs src/unix/haiku/mod.rs
src/unix/notbsd/linux/mod.rs and src/unix/solaris/mod.rs
- Add some functions to android that was cfged out
- Remove cf* and tc* functions implementations for android
(they are available with api >= 12, which was release in 2011)
Add ppoll() for all unix platforms
I'm unsure of whether there is support in OS X for this, and I can't find anything online (so I'm betting there isn't), but I'm going to let this run through CI to confirm.
- some tests are failing
- remove readlink, timegm and sig* functions in favor of the
unix/mod.rs definitions
- remove time64_t (it is not defined for aarch64)
- move some definitions to android/b32.rs and create appropriated
definitions in android/b64.rs
I'm unsure of whether there is support in OS X for this, and I can't find
anything online (I'm betting there isn't), but I'm going to let this run
through CI to confirm
add tmpnam and pthread_exit
tmpnam and readdir are trivial IMO.
About the `pthread_create` change: It needs `unsafe` for passing `C` functions to pthread_create (with rust functions the omission of `unsafe` is working of course).
`bindgen` produces this function definition:
```
pub fn pthread_create(arg1: *mut pthread_t,
arg2: *const pthread_attr_t,
arg3: Option<unsafe extern "C" fn(arg1: *mut c_void) -> *mut c_void>,
arg4: *mut c_void) -> c_int;
```
So it would add an additional `Option` around the function. But that would break existing code which uses `libc::pthread_create` and what use is it to call pthread_create without any function pointer, so I left `Option` out.
For reference: I also opened a [stackoverflow question](http://stackoverflow.com/questions/42284562) where the answers were also suggesting adding `unsafe` to the function definition.
Make readdir available on all unix targets
The readdir_r call has problems, and we'll probably want to move to
readdir on many, if not most, unix targets. This patch makes readdir
available in unix, rather than just solaris as before.
See https://github.com/rust-lang/rust/issues/40021
The readdir_r call has problems, and we'll probably want to move to
readdir on many, if not most, unix targets. This patch makes readdir
available in unix, rather than just solaris as before.
See https://github.com/rust-lang/rust/issues/40021
Having the B* constants in `unix/notbsd/mod.rs` passed CI tests
except for powerpc. So we'll try moving into individual
arch/ABI that the CI tests cover for now. This commit should
pass for the following:
- mips32
- mips64
- musl32
- musl64
- android32
- android64
- arm32
- aarch64
- x86
- x86_64
Then we can figure out the powerpc variants. This also prevents
potential errors for sparc64 which is not covered by CI.
Added *_setpshared and *_getpshared bindings
Adding bindings to posix pthreads functions vital for IPC via shared memory.
That's my first PR into libc and I'm not proficient in unix systems programming, so I would really appreciate if someone reviewed it in case I missed something regardrless of the passed tests.
Thanks!
posix definitions should be used on Solaris
For compatibility reasons, Solaris historically had its header files
setup so that, unless specifically requested through specific header
defines, either the old pre-POSIX interfaces or POSIX.1c Draft 6
interfaces were used. However, in the case of rust, since these symbols
are linked directly instead of via system header files, the underlying
posix symbol name can be used directly instead.
These definitions should be corrected to match what they do on almost
every other platform.
Be aware this is a breaking change in terms of interface for any crates
/ consumers of these interfaces for Solaris.
Fixes#522