- Jan 17, 2017
-
-
Alex Crichton authored
-
bors authored
Added some DragonFly-only ttycom.h constants. I overlooked some DragonFly-only constants in the last PR.
-
bors authored
unix: add fchdir(2) Add missing [fchdir(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html) function - chdir to an open file descriptor. Fixes https://github.com/rust-lang/libc/issues/495
-
bors authored
Fix for removed OS X constants. https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html Fixes https://github.com/rust-lang/libc/issues/480
- Jan 16, 2017
-
- Jan 15, 2017
-
-
Luca Bruno authored
-
- Jan 14, 2017
-
-
Johannes Lundberg authored
-
johalun authored
-
bors authored
Added defines from ttycom.h for dragonfly and freebsd. I wasn't sure about the convention but looking at other files it seems that whatever is over 0x80000000 is c_ulong so I went with that.
-
- Jan 13, 2017
-
-
johalun authored
-
- Jan 10, 2017
-
-
bors authored
Add waitid and related constants and types. [`waitid`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html) is a variation on `waitpid` with a marginally more convenient way of reporting the status, and a couple of handy additional features, such as the ability to peek at an exit status without consuming it. It's in POSIX.1-2008 and should be available on all supported Unixes. Along with it come the type `idtype_t` and the constants `WEXITED`, `WSTOPPED`, `WCONTINUED`, and `WNOWAIT`. The constants were already defined for unix/notbsd platforms. The patch is currently incomplete: I'm pushing it to get CI to test platforms I don't have. Todo list is * [x] Add a definition of `siginfo_t` to all platforms that don't have it. * [x] Verify that the new constants are consistent for all \*BSD platforms. * [x] Verify that `idtype_t` is consistent across the board. * [x] Add `link_name` annotations for `waitid` if/as necessary.
-
Zack Weinberg authored
-
Zack Weinberg authored
-
bors authored
Add MSG_PEEK socket flag #### MSG_PEEK This PR exposes a cross-platform `MSG_PEEK` flag that a user may pass into the `flags` parameter for `recv()`, `recvfrom()`, or `recvmsg()` calls. ``` MSG_PEEK This flag causes the receive operation to return data from the beginning of the receive queue without removing that data from the queue. Thus, a subsequent receive call will return the same data. ``` In short, users may call `recv()` to "peek" at new data (or a message) without consuming it. Recall that in the normal case, calls to `recv()` consume the data from the socket's receive queue, making it unavailable to future calls. #### Motivation This change enables `libc` users, such as the rust standard library, to potentially add peeking functionality to TCP and UDP implementations, like `TcpStream` and `UdpSocket`, without being concerned about the highly platform-dependent nature of the flags. (In this case, the flag's value `0x2` is very consistent, but that is not the case for many of the `MSG_*` flags. It makes sense to keep these differences confined to `libc`) #### Reference [bsd/apple: socket.h](https://opensource.apple.com/source/xnu/xnu-2050.7.9/bsd/sys/socket.h) [bsd/freebsdlike/freebsd: socket.h](https://github.com/freebsd/freebsd/blob/master/sys/sys/socket.h#L418) [bsd/freebsdlike/dragonfly: socket.h](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/1f249c981c4e89e7cde1836a75b61cac36dc7ac5/sys/sys/socket.h#L367) [bsd/netbsdlike: socket.h](https://github.com/IIJ-NetBSD/netbsd-src/blob/af5d253140491f2d1816c59ecb8a4d8a8d927688/sys/sys/socket.h#L517) [unix/haiku: socket.h](https://github.com/haiku/haiku/blob/b65adbdfbc322bb7d86d74049389c688e9962f15/headers/posix/sys/socket.h#L114) [unix/notbsd/linux: socket.h](https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/include/linux/socket.h#L264) [unix/notbsd/android: socket.h](https://android.googlesource.com/platform/development/+/73a5a3baaa5089f1ab2049e5934fa5d8a3f3e76a/ndk/platforms/android-20/include/sys/socket.h#229)
-
Tyler Julian authored
-
- Jan 08, 2017
-
-
Zack Weinberg authored
-
Zack Weinberg authored
It turns out that *only* FreeBSD and NetBSD proper have waitid, and that Solaris' additional W* constants are totally different from everyone else's, which tips me over from 'find some way to shoehorn this into the top-level unix/mod.rs' to 'put it in the submodules, live with the code duplication'.
-
- Jan 07, 2017
-
-
bors authored
Remove kind='static' from Redox linkage Our cross compiler links binaries statically, and the rustc target has dynamic linking disabled - adding kind = "static" is not necessary.
-
- Jan 06, 2017
-
-
Zack Weinberg authored
* OpenBSD doesn't have idtype_t or the P_* constants either * FreeBSD has different values for the P_* constants * Android gives idtype_t a different signedness * Disable waitid on NetBSD as it causes a link failure - I think this may be a problem with the test environment
-
bors authored
Add getpeereid function This is a wrapper around getsockopt() for getting the uid/gid of a remote Unix domain socket peer. It was added in FreeBSD 4.6 and present in all modern BSDs I checked (including Mac OS X).
-
James Brown authored
This is a wrapper around getsockopt() for getting the uid/gid of a remote Unix domain socket peer. It was added in FreeBSD 4.6 and present in all modern BSDs I checked (including Mac OS X).
-
Zack Weinberg authored
* idtype_t no longer an enum. * Darwin/x86-32 needs the $UNIX2003 thing. * Darwin, FreeBSD, and NetBSD all have different values for the new constants. * OpenBSD doesn't have this feature at all. (Hopefully we can get away with defining idtype_t anyway.)
-
Jeremy Soller authored
-
Zack Weinberg authored
waitid() is a variation on waitpid() with a marginally more convenient way of reporting the status, and a couple of handy additional features, such as the ability to peek at an exit status without consuming it. It's in POSIX.1-2008 and should be available on all supported Unixes. Along with it come the type 'idtype_t' and the constants WEXITED, WSTOPPED, WCONTINUED, and WNOWAIT. Theconstants were alre dy defined for unix/notbsd platforms. Patch incomplete: several targets are going to have to add definitions of siginfo_t, but I'm not sure which ones yet.
-
bors authored
Link libc and libm in Redox [critical] This is critical to being able to set up a proper cross compilation setup for Redox. Due to the way libc is vendored, I have to have this change merged in and have liblibc updated in the Rust repository as well before I can have a working buildbot for Redox.
-
Jeremy Soller authored
-
- Jan 04, 2017
-
-
Alex Crichton authored
Bump to 0.2.19
-
Alex Crichton authored
-
- Jan 03, 2017
-
-
bors authored
Add Solaris constants for fcntl-style advisory locking Solaris doesn't implement flock(), so any Rust implementation of flock() will need to implement it using fcntl(), using the F_RDLCK, F_WRLCK, and F_UNLCK constants.
-
Danek Duvall authored
-
Danek Duvall authored
Solaris doesn't implement flock(), so any Rust implementation of flock() will need to implement it using fcntl(), using the F_RDLCK, F_WRLCK, and F_UNLCK constants.
-
bors authored
Support Neg and Not in no_core mode. Needed by rust-lang/rust#38776 which requires the traits to be implemented even for integer types. This is already the case with binary operator traits, which always require the trait and its impls.
-
- Jan 02, 2017
-
-
Eduard-Mihai Burtescu authored
-
- Jan 01, 2017
-
-
bors authored
sparc64-linux support This needs to be "cleaned" up to use modules instead of a bunch of `cfg`s ... Sadly, sparc64 constants are very different from other architectures so cleaning this will result in a bunch of duplication, I think. While working on this, I was wondering why the constants are not written like this: ``` rust // linux/mod.rs const COMMON: ::c_int = 3; cfg_if! { if #[cfg(target_arch = "sparc64")] { const FOO: ::c_int = 1; } else if #[cfg(any(target_arch = "mips64", target_arch = "x86_64"))] { const FOO: ::c_int = 2; } else { // unsupported/unknown architecture } } ``` I think this might result in less duplicated code. @alexcrichton Has something like that ^ been attempted before?
-
Jorge Aparicio authored
-
- Dec 31, 2016
-
-
Jorge Aparicio authored
-
Jorge Aparicio authored
-
- Dec 29, 2016
-
-
bors authored
Added initgroups Not sure whether this is the correct platform level. I'll wait for CI to find out.. EDIT: Okay now it builds on all platforms but I think this configuration does not add the function on BSD where it has the same signature as on Linux.
-
bors authored
Add execl, execle, execlp I tried to be as close as possible to the existing definitions of `execv` and friends. btw: do you still welcome these PR? Doesn't the [new bindgen/build.rs method](http://fitzgeraldnick.com/2016/12/14/using-libbindgen-in-build-rs.html) offer to automate this crate to 100%
-