Commit Graph

1180 Commits

Author SHA1 Message Date
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
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
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
Zac Berkowitz
e393a2d4a0 Adding termios.h to openbsd headers.
Attempting to correct for conflicting defines from `rpcsvc/rex.h`
2017-02-20 20:49:19 +00:00
Zac Berkowitz
6fbb8d5974 Added baudrate constants. 2017-02-20 14:05:57 +00:00
Philipp Keller
828c64c2a4 fix c_void 2017-02-19 13:40:29 +01:00
Philipp Keller
010a8275db Add pthread_exit 2017-02-19 13:30:54 +01:00
Philipp Keller
cf3e0676c5 pthread_create expects an unsafe function 2017-02-18 11:02:04 +01:00
Philipp Keller
67f1c5c23f Merge branch 'master' of https://github.com/rust-lang/libc 2017-02-18 10:56:50 +01:00
bors
3ae5203dd1 Auto merge of #526 - monadbobo:epollexclusive, r=alexcrichton
Add EPOLLEXCLUSIVE that is added in Linux 4.5.

Add [EPOLLEXCLUSIVE](https://kernelnewbies.org/Linux_4.5#head-64f3b13b9026133a232a418a27ac029e21fff2ba) that is added in Linux 4.5.
2017-02-17 15:28:18 +00:00
Simon Liu
d6fbc0d0c2 Add EPOLLEXCLUSIVE that is added in Linux 4.5. 2017-02-17 23:25:19 +08:00
bors
532d80cdc1 Auto merge of #524 - mersinvald:pshared_attrs, r=alexcrichton
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!
2017-02-17 05:41:18 +00:00
Mike Lubinets
c0c7de7c02 Added *_setpshared and *_getpshared bindings 2017-02-16 15:54:19 +03:00
bors
7a3754f2bb Auto merge of #523 - binarycrusader:master, r=alexcrichton
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
2017-02-16 01:53:54 +00:00
Shawn Walker-Salas
6740a8aa0b 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
2017-02-15 16:19:06 -08:00
bors
53bb038895 Auto merge of #521 - radupopescu:master, r=alexcrichton
WIFCONTINUED function on Linux and FreeBSD

* Adds the missing WIFCONTINUED function to Linux (in `src/unix/notbsd/mod.rs`).
* Modifies the signature of WIFCONTINUED on FreeBSD (`src/unix/bsd/freebsdlike/mod.rs`) to be consistent with the ones on MacOS and Linux.
2017-02-14 15:12:09 +00:00
Radu Popescu
ff8c71aa7e Make WIFCONTINUED signature on FreeBSD consistent with MacOS and Linux 2017-02-13 00:29:06 +01:00
Radu Popescu
ab2fb241f3 Adding WIFCONTINUED function on "notbsd" platform 2017-02-13 00:27:27 +01:00
bors
cfc0165693 Auto merge of #518 - binarycrusader:master, r=alexcrichton
Add missing MSG_PEEK definition for Solaris

Fixes #517
2017-02-10 16:20:31 +00:00
Shawn Walker-Salas
463e9584a9 Add missing MSG_PEEK definition for Solaris.
Fixes #517
2017-02-10 07:17:45 -08:00
Shawn Walker-Salas
c9548a5766 Merge pull request #1 from rust-lang/master
Auto merge of #516 - binarycrusader:master, r=alexcrichton
2017-02-10 07:14:16 -08:00
bors
0056dbe376 Auto merge of #516 - binarycrusader:master, r=alexcrichton
Correct solaris libc definitions:

* pthread_t is defined as uint_t, so must be c_uint, not uintptr_t, just
  as pthread_key_t is already defined
* fd_set is defined as long, so must be i32/i64 based on
  target_pointer_width; this also fixes an indirect endianness issue
  encountered on sparc
* FD_SETSIZE should be defined as 65536 when target_pointer_width = 64

Fixes #515
2017-02-10 02:19:59 +00:00
Shawn Walker-Salas
86b0cab132 * make tidy happy 2017-02-09 10:29:46 -08:00
Shawn Walker-Salas
8304e06b53 Correct solaris libc definitions:
* pthread_t is defined as uint_t, so must be c_uint, not uintptr_t, just
  as pthread_key_t is already defined
* fd_set is defined as long, so must be i32/i64 based on
  target_pointer_width; this also fixes an indirect endianness issue
  encountered on sparc
* FD_SETSIZE should be defined as 65536 when target_pointer_width = 64

Fixes #515
2017-02-08 10:43:11 -08:00
bors
6813109fae Auto merge of #514 - DoumanAsh:missing_af_unspec, r=alexcrichton
Add AF_UNSPEC from Apple socket.h

[socket.h](https://opensource.apple.com/source/xnu/xnu-792.13.8/bsd/sys/socket.h) of Apple contains this definition so i'm not sure why it is missing from libc.
The same goes for other BSD-like OSes...
Is there some particular reasons why it is so?
2017-02-07 17:40:22 +00:00
Douman
45ba8c13cf Add AF_UNSPEC from Apple socket.h 2017-02-07 10:51:42 +03:00
Philipp Keller
1fbe9520d4 Merge branch 'master' of https://github.com/rust-lang/libc 2017-02-06 06:36:12 +01:00
bors
8d8264b967 Auto merge of #512 - dumbbell:support-aarch64-unknown-freebsd, r=alexcrichton
Add types for `aarch64-unknown-freebsd`
2017-02-03 20:29:05 +00:00
bors
b491fb30d5 Auto merge of #510 - Antti:add-wcstombs, r=alexcrichton
Add wcstombs

Add `wcstombs` function to convert from wide chars to multibyte chars.

The `wcstombs(`) function conforms to ISO/IEC 9899:1999 (ISO C99)
2017-02-03 19:36:51 +00:00
bors
5e16e98aac Auto merge of #513 - alexcrichton:fix, r=alexcrichton
Fix the i686-unknown-linux-musl target CI
2017-02-03 19:00:28 +00:00
Alex Crichton
d862a3698c Fix the i686-unknown-linux-musl target 2017-02-03 10:59:40 -08:00
Jean-Sébastien Pédron
1363fe4a03
Add types for aarch64-unknown-freebsd
`aarch64.rs` was copied and adapted from `x86_64.rs`.
2017-02-03 18:10:56 +01:00
Andrii Dmytrenko
c01fd6f48e
Add wcstombs
The wcstombs() function conforms to ISO/IEC 9899:1999 (``ISO C99'')
2017-02-03 12:05:14 +00:00
bors
04d2c7af0c Auto merge of #508 - APTy:ipproto-icmp, r=alexcrichton
Add IPPROTO_ICMP and IPPROTO_ICMPV6 system constants

This adds the protocol value for `ICMP` in both IPv4 and IPv6 variants.

ICMP protocol constant for IPv4 defined as `1` per [RFC 792](https://tools.ietf.org/html/rfc792)
ICMP protocol constant for IPv6 defined as `58` per [RFC 2463](https://tools.ietf.org/html/rfc2463#section-1)

#### Reference
[bsd/apple: netinet/in.h](https://opensource.apple.com/source/xnu/xnu-1699.24.8/bsd/netinet/in.h)
[bsd/freebsdlike/freebsd: netinet/in.h](https://github.com/freebsd/freebsd/blob/master/sys/netinet/in.h#L42)
[bsd/freebsdlike/dragonfly: netinet/in.h](1f249c981c/sys/netinet/in.h (L64))
[bsd/netbsdlike: netinet/in.h](af5d253140/sys/netinet/in.h (L77))
[unix/haiku: netinet/in.h](b65adbdfbc/headers/posix/netinet/in.h (L54))
[unix/notbsd/linux: in.h](8fa3b6f939/include/uapi/linux/in.h (L31)) - [unix/notbsd/linux: in6.h](8fa3b6f939/include/uapi/linux/in6.h (L134))
2017-02-02 02:05:55 +00:00