Commit graph

1123 commits

Author SHA1 Message Date
Mathias Svensson 6207166bc9 Add O_TMPFILE constant 2017-01-29 02:49:09 +01:00
bors bce927b368 Auto merge of #502 - oconnor663:pipe2_bsd, r=alexcrichton
add pipe2 to non-OSX BSD's

https://github.com/rust-lang/libc/issues/500
2017-01-25 18:45:23 +00:00
Jack O'Connor 7c0673070f add pipe2 to non-OSX BSD's
https://github.com/rust-lang/libc/pull/501
2017-01-25 13:09:22 -05:00
bors 4eb6bf9cc9 Auto merge of #498 - learnopengles:run-ios-tests, r=alexcrichton
Run ios tests

This WIP PR runs the tests on the iOS simulator. I've tested it locally using macOS Sierra and XCode 8.2.1. I get this output:

RUNNING ALL TESTS
PASSED 6756 tests

The python script probably needs to be customized for the specific failure output from this test runner (update: newest commit should have this).
2017-01-18 18:21:23 +00:00
Alex Crichton d4a5fce471 Touch up the iOS deploy script 2017-01-18 10:20:13 -08:00
Kevin Brothaler 3800c7380c Fixup target triple name 2017-01-17 21:38:37 -04:00
Kevin Brothaler a40c92aa27 Removed non-mandatory UIRequiredDeviceCapabilities
It’s not clear if these values are used or needed by the simulator. The doc only seems to mention arm values for the actual device:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3
2017-01-17 21:35:27 -04:00
Kevin Brothaler f8e12769ca Replace Python script with Rust script. 2017-01-17 21:19:30 -04:00
Kevin Brothaler 938955c0f4 Fix i386-apple-ios 2017-01-17 14:47:08 -04:00
Kevin Brothaler 4bcad05d03 osx_image was in the wrong place? 2017-01-17 14:47:08 -04:00
Kevin Brothaler fdee442356 Pass the tests only if we find an expected positive output (rather than checking for negative output to fail the tests). 2017-01-17 14:47:08 -04:00
Kevin Brothaler a6f50bb61a Update output check based on all.rs test output 2017-01-17 14:47:08 -04:00
Kevin Brothaler c8a4d214eb Run the unit tests on the iOS simulator for x86_64-apple-ios 2017-01-17 14:47:08 -04:00
bors 6ec4f81a38 Auto merge of #499 - alexcrichton:bump, r=alexcrichton
Bump to 0.2.20
2017-01-17 16:59:31 +00:00
Alex Crichton d30b4c6fe0 Bump to 0.2.20 2017-01-17 08:58:24 -08:00
bors efeb501c97 Auto merge of #494 - johalun:dragonfly-ttycom, r=alexcrichton
Added some DragonFly-only ttycom.h constants.

I overlooked some DragonFly-only constants in the last PR.
2017-01-17 03:05:55 +00:00
bors d1a7591204 Auto merge of #496 - lucab:to-upstream/fchdir, r=alexcrichton
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
2017-01-17 02:47:22 +00:00
bors 18a1de5a09 Auto merge of #497 - learnopengles:master, r=alexcrichton
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
2017-01-17 02:06:45 +00:00
Kevin Brothaler 7fbff3a443 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
2017-01-16 12:49:49 -04:00
Luca Bruno 7a26079585
unix: add fchdir(2) 2017-01-15 16:51:01 +00:00
Johannes Lundberg a3634a5183 Update mod.rs 2017-01-14 10:42:09 -08:00
johalun 2c23fd0c8b Added some DragonFly-only constants. 2017-01-14 02:10:44 -08:00
bors 4fe2cc22e7 Auto merge of #493 - johalun:freebsd-ttycom, r=alexcrichton
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.
2017-01-14 07:54:22 +00:00
johalun 2d108fe77d Added defines from ttycom.h for dragonfly and freebsd. 2017-01-13 08:49:36 -08:00
bors cb7f667321 Auto merge of #489 - zackw:add-waitid, r=alexcrichton
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.
2017-01-10 19:34:06 +00:00
Zack Weinberg 84bce949d6 Remove remaining copy of the comment about idtype_t being an enum. 2017-01-10 13:08:19 -05:00
Zack Weinberg 984fb54d83 Changes requested by reviewers 2017-01-10 11:09:51 -05:00
bors 33ff832e8f Auto merge of #492 - APTy:add-socket-peek-flag, r=alexcrichton
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](1f249c981c/sys/sys/socket.h (L367))
[bsd/netbsdlike: socket.h](af5d253140/sys/sys/socket.h (L517))
[unix/haiku: socket.h](b65adbdfbc/headers/posix/sys/socket.h (L114))
[unix/notbsd/linux: socket.h](5924bbecd0/include/linux/socket.h (L264))
[unix/notbsd/android: socket.h](73a5a3baaa/ndk/platforms/android-20/include/sys/socket.h (229))
2017-01-10 06:25:05 +00:00
Tyler Julian b619df8fd4 Add MSG_PEEK socket flag 2017-01-09 18:29:34 -08:00
Zack Weinberg f05e48cfb5 Patch in id_t missing in a few places 2017-01-07 20:52:47 -05:00
Zack Weinberg 31d9779591 Reorganize again; more portability fixes.
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'.
2017-01-07 20:04:42 -05:00
bors 95d5534d0f Auto merge of #490 - redox-os:master, r=alexcrichton
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.
2017-01-07 15:51:00 +00:00
Zack Weinberg f1a91da7aa Another round of portability fixes:
* 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
2017-01-06 18:55:32 -05:00
bors 89c6c6c83e Auto merge of #491 - Roguelazer:add_getpeereid_function, r=alexcrichton
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).
2017-01-06 22:40:07 +00:00
James Brown 4e6dd24297 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).
2017-01-06 13:36:05 -08:00
Zack Weinberg 644929ad10 Corrections based on CI failures.
* 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.)
2017-01-06 16:01:19 -05:00
Jeremy Soller 52369bcac1 Remove kind='static' 2017-01-06 13:16:22 -07:00
Zack Weinberg 9d1e4848d5 Add waitid and related constants and types.
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.
2017-01-06 12:04:25 -05:00
bors c900083bbf Auto merge of #488 - redox-os:redox, r=alexcrichton
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.
2017-01-06 17:03:21 +00:00
Jeremy Soller 74590038ae Link libc and libm 2017-01-06 09:42:36 -07:00
Alex Crichton 3ae8c850aa Merge pull request #487 from alexcrichton/bump
Bump to 0.2.19
2017-01-04 14:35:38 -08:00
Alex Crichton a2dd65a5a8 Bump to 0.2.19 2017-01-04 13:52:33 -08:00
bors 4f3ec99b53 Auto merge of #485 - dhduvall:solaris-flock, r=alexcrichton
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.
2017-01-03 23:08:55 +00:00
Danek Duvall 14eaaf8d37 Fix a brown-paper-bag bug: botched constant types. 2017-01-03 15:06:58 -08:00
Danek Duvall 8c0595d20f 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.
2017-01-03 14:20:47 -08:00
bors 7d57bdcdbb Auto merge of #484 - eddyb:dox-unops, r=alexcrichton
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.
2017-01-03 19:01:07 +00:00
Eduard-Mihai Burtescu 974f7ba2e0 Support Neg and Not in no_core mode. 2017-01-03 00:29:27 +02:00
bors 3e895791fb Auto merge of #483 - japaric:sparc64, r=alexcrichton
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?
2017-01-01 01:19:25 +00:00
Jorge Aparicio 67615b49d5 tidy and last minute fixes 2016-12-31 20:00:49 -05:00
Jorge Aparicio 540d140af8 less cfg, way more code 2016-12-31 16:40:13 -05:00