Commit graph

1211 commits

Author SHA1 Message Date
Kamal Marhubi d24e86c9d7 Bump to 0.2.21
closes https://github.com/rust-lang/libc/issues/539
2017-03-01 19:00:07 -05:00
bors d197e21015 Auto merge of #543 - berkowski:socket_constants, r=alexcrichton
Adds many socket related constants

Started off adding a few constants to help cleaning up some `nix-rust/nix` issues.  Went a little.. further.

Adds lots of socket-related constants (`PF_*`, `MSG_*`, `AF_*`, `SO_*`, `SOL_*`, etc.) to linux/bsd flavors.

Added constants to `bsd/frebsdlike/dragonfly` for completeness, though they aren't covered by CI.  Did not touch `notbsd/linux/s390x.rs`
2017-03-01 22:59:11 +00:00
Zac Berkowitz 985ea406ec Added #[doc(hidden)] to AF_MAX, PF_MAX, others. 2017-03-01 18:06:01 +00:00
Zac Berkowitz fa1962641a Added socket constants for apple 2017-03-01 18:06:01 +00:00
Zac Berkowitz 27ce7b1575 Cleaned up unused socket constants. 2017-03-01 18:06:01 +00:00
Zac Berkowitz 5494238c47 Added many socket-related constants to BSD 2017-03-01 18:06:01 +00:00
Zac Berkowitz 1479ea84fe Added many socket-related constants to linux 2017-03-01 18:06:01 +00:00
bors 612a5861da Auto merge of #538 - malbarbo:ci-android, r=alexcrichton
Add and fix tests for {i686, aarch64}-linux-android targets

I think that these changes do not breaks compatibility.

There are some types and constants changes to i686 and aarch64, but I see these changes as bug fixes instead of breaking changes. Also the type time64_t was remove from aarch64 because it is not defined in this arch.

Fixes #536
2017-03-01 16:24:39 +00:00
bors 331b179a7b Auto merge of #542 - Susurrus:master, r=alexcrichton
Add OXTABS and ONOEOT for BSD systems

According to all references I could find these are BSD extensions to POSIX and are also supported on OS X.
2017-02-28 17:14:12 +00:00
Bryant Mairs cda0f200da Add OXTABS and ONOEOT for BSD systems 2017-02-28 08:49:26 -08:00
Marco A L Barbosa b2791dbef0 Merge branch 'master' into ci-android 2017-02-27 23:10:55 -03:00
bors 5dd2f3917b Auto merge of #541 - Susurrus:more_termios, r=alexcrichton
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)`.
2017-02-27 20:55:56 +00:00
Marco A L Barbosa 9a20f93222 Fix style 2017-02-27 17:54:51 -03:00
Marco A L Barbosa a3759d7feb Fix missing prefix :: 2017-02-27 17:40:58 -03:00
Marco A L Barbosa bfeb3606f2 Merge branch 'master' into ci-android 2017-02-27 17:25:43 -03:00
Marco A L Barbosa fab2d30ada Remove cfg_if from src/unix/mod.rs
- 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)
2017-02-27 16:41:57 -03:00
Marco A L Barbosa 1175c6657d Remove cfg_if from src/unix/notbsd/android/ 2017-02-27 16:41:43 -03:00
Bryant Mairs 39e554f3f8 Add cfmakeraw and cfsetspeed
This includes implementations for Android.
2017-02-27 09:54:58 -08:00
bors b9a0a6a77c Auto merge of #537 - Susurrus:master, r=alexcrichton
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.
2017-02-24 20:53:44 +00:00
bors dc1aa0e2c0 Auto merge of #530 - berkowski:baud_constants, r=alexcrichton
Added baudrate constants.

Addresses #528, adding baudrate constants for `bsd` and `notbsd` flavors of `unix`.

Passes `libc-test` locally on ubuntu 14.04 LTS with the additional (uncommitted) entries into in `build.rs`:

```
cfg.skip_const( move |name| {
        match name {
            # ... snip ...
            "PTRACE_O_SUSPEND_SECCOMP" |
            "CLONE_NEWCGROUP" |
            "NETLINK_LIST_MEMBERSHIPS" |
            "NETLINK_LISTEN_ALL_NSID" |
            "NETLINK_CAP_ACK" |
            "PR_CAP_AMBIENT_CLEAR_ALL" |
            "PR_CAP_AMBIENT_LOWER" |
            "PR_CAP_AMBIENT_RAISE" |
            "PR_CAP_AMBIENT_IS_SET" |
            "PR_CAP_AMBIENT" |
            "PR_FP_MODE_FRE" |
            "PR_FP_MODE_FR" |
            "PR_GET_FP_MODE" |
            "PR_SET_FP_MODE" |
            "PR_MPX_DISABLE_MANAGEMENT" |
            "PR_MPX_ENABLE_MANAGEMENT" |
            "PR_GET_THP_DISABLE" |
            "PR_SET_THP_DISABLE" |
            "PR_SET_MM_MAP_SIZE" |
            "PR_GET_MM_MAP_SIZE" |
            "PR_SET_MM_MAP" |
            "NLM_F_DUMP_FILTERED" |
            "EPOLLEXCLUSIVE" => true,

            _ => false,
        }
    });
```
I'm assuming this is because I'm stuck using `linux-libc-dev:3.13.0-24.46` for the moment and those constants are defined in newer versions.
2017-02-24 20:25:55 +00:00
Marco A L Barbosa d500a458a0 Enable travis tests for {i686, aarch64}-linux-android 2017-02-24 17:21:56 -03:00
Marco A L Barbosa f2f1129672 Fix aarch64-linux-android failing tests 2017-02-24 17:03:51 -03:00
Marco A L Barbosa 92ce51823c Make libc-tests compile for aarch64-linux-android
- 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
2017-02-24 16:24:49 -03:00
Zac Berkowitz 004814849d Removed "rpcsvc/rex.h" from build.rs for OpenBSD
```
export TARGET=x86_64-unknown-openbsd
export QEMU=openbsd.qcow2
sh ci/run-docker.sh $TARGET
```
Passes when run localy.
2017-02-24 18:51:51 +00:00
Zac Berkowitz 62ec26aacc Changed CBAUDEX to 0b000020 on ppc and ppc64 2017-02-24 18:17:22 +00:00
Zac Berkowitz bd6e72db5d Changed CBAUDEX to 0o010000 for ppc and ppc64 2017-02-24 17:59:04 +00:00
Zac Berkowitz e8fc9928cd Removed "termios.h" from build.rs openbsd case.
Adding `termios.h` behind `rpcsvc/rex.h` does not solve the #define
clash since `rex.h` also defines the `_SYS_TERMIOS_H_` include guard.
2017-02-24 17:20:34 +00:00
Bryant Mairs 88e37f278c Fix path for nfds_t 2017-02-24 08:59:22 -08:00
Bryant Mairs 871f3b2cf6 Expose ppoll on some BSDs 2017-02-24 08:46:27 -08:00
Bryant Mairs 6d5aa56e71 Unify import style 2017-02-24 08:46:00 -08:00
Bryant Mairs 029cd2d957 Only expose ppoll on non-BSD targets 2017-02-24 08:07:19 -08:00
Bryant Mairs d86901e259 Fix timeout argument type 2017-02-23 15:03:41 -08:00
Bryant Mairs f79eed589a Fix style errors 2017-02-23 14:46:56 -08:00
Marco A L Barbosa c53251867f Fix i686-linux-android failing tests 2017-02-23 16:40:28 -03:00
Marco A L Barbosa 599eec3781 Add test support for {aarch64, i686}-linux-android 2017-02-23 16:08:29 -03:00
Bryant Mairs cd8447550d 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 (I'm betting there isn't), but I'm going to let this run
through CI to confirm
2017-02-23 10:21:42 -08:00
bors 684be76eca Auto merge of #527 - philippkeller:master, r=alexcrichton
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.
2017-02-23 15:50:17 +00:00
Philipp Keller cbdf43b7f4 Remove duplicate readdir definition 2017-02-23 06:20:23 +01:00
Philipp Keller 780cd2897c Merge branch 'master' of https://github.com/rust-lang/libc 2017-02-23 06:17:45 +01:00
Philipp Keller 437c54c3e1 Remove again as coersion was only introduced late last year 2017-02-22 20:42:45 +01:00
bors 16832447b4 Auto merge of #532 - malbarbo:fs2-android, r=alexcrichton
Add definitions to Android to allow fs2 crate compile

This is the only missing part to allow cargo to compile on android.
2017-02-22 17:41:08 +00:00
bors 64d954c6a7 Auto merge of #533 - raphlinus:master, r=alexcrichton
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
2017-02-22 13:59:54 +00:00
Zac Berkowitz fb11c7a9ec Removed BOTHER const from powerpc and powerpc64 2017-02-22 10:30:50 +00:00
Raph Levien 02990f2fd2 Change return type of readdir to *mut ::dirent
Apparently a lot of libc's don't put "const" on the return type for
readdir, which causes type mismatch.
2017-02-21 19:13:16 -08:00
Raph Levien e010078127 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
2017-02-21 15:07:03 -08:00
Marco A L Barbosa bad80ba4d7 Add definitions to Android to allow fs2 crate compile 2017-02-21 17:17:46 -03:00
bors 0824426826 Auto merge of #531 - freqlabs:master, r=alexcrichton
Add jail functions and constants for FreeBSD

These are the system calls for creating and managing jails on FreeBSD.
2017-02-21 19:40:14 +00:00
Zac Berkowitz 43e8557c05 Added baud constants for powerpc 2017-02-21 00:45:01 +00:00
Ryan Moeller 7c03711d45 Add jail functions and constants for FreeBSD 2017-02-21 00:41:12 +00:00
Zac Berkowitz 1a9112d2d8 Moved linux baud constants into individual archs.
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.
2017-02-21 00:16:10 +00:00