Commit Graph

1199 Commits

Author SHA1 Message Date
luozijun
0061cc9510 Fix code style and add sockaddr_dl for xnu 2017-12-12 11:02:47 +08:00
luozijun
722e133d78 merge 2017-12-12 00:50:29 +08:00
Bryant Mairs
35992f23be Add struct ucred for Linux on MIPS 2017-12-07 21:17:19 -08:00
Bryant Mairs
011ba6d8f2 Add ucred-like structs for FreeBSDs and NetBSD 2017-12-07 18:30:41 -08:00
Bryant Mairs
6cf652ed36 Remove unnecessary unsafe block
Removes a compilation warning
2017-12-06 21:32:05 -08:00
luozijun
4d3826a980 FIX style 2017-12-06 18:58:43 +08:00
luozijun
49b4213a18 FIX 2017-12-06 17:29:04 +08:00
寧靜
f688621ea6
Add struct sockaddr_dl for macos and freebsd 2017-12-06 14:09:22 +08:00
bors
b080eb5c3a Auto merge of #865 - cactorium:master, r=alexcrichton
Minor fixes for mips-unknown-linux-uclibc

Just adding a few definitions so the toolchain compiles
2017-12-04 23:35:04 +00:00
Bryant Mairs
97925e931c Add more FreeBSD errnos 2017-12-03 17:52:22 -08:00
bors
d8fc152fc1 Auto merge of #863 - Susurrus:netbsd_errnos, r=alexcrichton
Add additional errno constants for NetBSD
2017-12-04 01:06:39 +00:00
Bryant Mairs
7ba66f7ca3 Add additional errno constants for NetBSD 2017-12-03 15:13:39 -08:00
Markus Wanner
13ce9f8b86 Use IFF_OACTIVE and IFF_RUNNING even on FreeBSD. Deprecate the DRV ones. 2017-11-28 23:18:11 +01:00
bors
1a2f9639f8 Auto merge of #855 - kallisti5:haiku-lutimes, r=alexcrichton
haiku: Add missing lutimes

* BeOS traditionally didn't have lutimes, however to make Haiku
  more compatible and easier to port for, we added an implementation
  of it.
2017-11-26 15:48:53 +00:00
Alexander von Gluck IV
f7d16bce0c haiku: Add missing lutimes
* BeOS traditionally didn't have lutimes, however to make Haiku
  more compatible and easier to port for, we added an implementation
  of it.
2017-11-25 10:15:08 -06:00
Taylor Cramer
5e9c614b9f Fix Fuchsia typos 2017-11-21 15:47:37 -08:00
bors
614199a8d1 Auto merge of #853 - bgermann:master, r=alexcrichton
Prerequisites to build libc-test on Solaris

These changes are required as a first step to Solaris CI.
2017-11-19 16:35:59 +00:00
bgermann
9e70e60293 Style 2017-11-19 13:52:07 +01:00
bgermann
13624c8e83 Solaris type correction 2017-11-18 20:27:51 +01:00
bgermann
d9208b3546 Correct port and dirent types 2017-11-18 19:21:53 +01:00
bgermann
c69f0b95a0 get rid of unnecessary configuration 2017-11-18 18:24:34 +01:00
bgermann
cf29ee668e Correct some interface constants' types 2017-11-18 17:56:36 +01:00
bgermann
2b948828c5 Remove fflags_t from Solaris
fflags_t is not commonly defined on Solaris or illumos.
2017-11-18 14:52:15 +01:00
bgermann
892115ad83 Change futimes to futimesat on Solaris
futimes is not commonly defined on Solaris, but futimesat is.
2017-11-18 14:50:40 +01:00
Michael Neumann
a9d80d6452 No fexecve() on DragonFly
This was not caught by libc-test, as checks for the execv functions
are disabled.
2017-11-17 12:50:18 +01:00
Michael Neumann
62ac76cbd5 Add WCONTINUED and WSTOPPED for DragonFly 2017-11-17 12:44:47 +01:00
Michael Neumann
ce48715a5e Add MADV_SETMAP for DragonFly 2017-11-17 12:36:29 +01:00
Bryant Mairs
c9d1e3923a Add errno getter for Android 2017-11-16 21:16:51 -08:00
Taylor Cramer
b4cfe883bb Reorganize Fuchsia module 2017-11-15 11:29:01 -08:00
Taylor Cramer
42b57da46b Update Fuchsia open flags 2017-11-15 10:37:05 -08:00
Taylor Cramer
f7f9be31c2 Move Fuchsia out of unix and into its own module 2017-11-15 10:22:26 -08:00
Kelvin Ly
fdcb8d96de Syntax fix 2017-11-14 14:23:10 -05:00
Kelvin Ly
58c3fa0feb Add some fixes to allow it to compile with newer libstd 2017-11-14 14:18:55 -05:00
roblabla
ae81dc8df4 Add aarch64 support to newlib bindings 2017-11-14 10:15:16 +01:00
Marco A L Barbosa
34aa991123 Add syscall table for Linux sparc64 2017-11-13 21:07:09 -02:00
bors
9e59cf98f1 Auto merge of #843 - sfackler:dylib, r=alexcrichton
Add dyld functions and related types

r? @alexcrichton
2017-11-11 10:09:02 +00:00
Steven Fackler
bbba4bfc7e Add dyld functions and related types 2017-11-10 21:10:51 -08:00
Steven Fackler
8f7839f41b Add dl_iterate_phdr and related types
A lot of this is more broadly supported than just Linux, but support for
those can be added later.
2017-11-10 20:04:08 -08:00
luozijun
165bbc36df FIX: line longer than 80 chars 2017-11-09 17:10:59 +08:00
luozijun
9108f5b51d Add network interface flag constants for all platforms
Add network interface flag constants for all platforms.
2017-11-09 16:54:03 +08:00
Bryant Mairs
fa81ab39c7 Expose MFD_ constants on all Linux targets.
These aren't exposed on non-MIPS musl targets, but since they're
part of a kernel API, they're still applicable, so we just don't
test them there but expose them anyways.
2017-11-06 19:16:41 -08:00
Greg V
715ed8cd19 Add SHM_ANON for FreeBSD 2017-11-06 21:52:28 +03:00
bors
e38483f494 Auto merge of #836 - Susurrus:memfd, r=alexcrichton
Add constants for memfd_create syscall
2017-11-06 03:15:44 +00:00
Bryant Mairs
c0935ac343 Add MFD_ constants for memfd_create 2017-11-05 13:52:59 -08:00
Guillaume Gomez
3a61e7a52f Fix rustdoc warning 2017-11-05 14:24:06 +01:00
bors
833e67ffb4 Auto merge of #830 - malbarbo:getrandom_const, r=alexcrichton
Add constants used by getrandom linux syscall

getrandom syscall was added in kernel 3.17. Musl and android seems to use old kernel headers, but considering that they define SYS_getrandom, the constants GRND_NONBLOCK and GRND_RANDOM should also be defined.
2017-11-02 17:51:18 +00:00
Marco A L Barbosa
ae49626940 Add constants used by getrandom linux syscall 2017-11-02 10:33:29 -02:00
Alex Crichton
d9933b77f9 Compile an empty library on wasm32 non-Emscripten
In preparation for eventually having a non-Emscripten based wasm32 target, this
commit makes `libc` the crate an empty library on wasm32 targets that are not
with `target_os = "emscripten"`. This may eventually get filled out over time,
but for now it's all empty!
2017-11-01 19:25:15 -07:00
Marco A L Barbosa
8fe5875699 Fix O_TMPFILE const for sparc64-unknown-linux-gnu 2017-10-31 10:10:35 -02:00
Marco A L Barbosa
a6c709142d Fix some s390x constants 2017-10-31 09:44:58 -02:00
William Orr
e83f20bc0d Add WCONTINUED const for OpenBSD 2017-10-29 14:34:34 -07:00
Marco A L Barbosa
19530c0d97 More fixes for x86_64-unknown-linux-gnux32 2017-10-27 07:16:08 -02:00
Vojtech Kral
a0e683ef94 Fix kqueue filter consts type on NetBSD 2017-10-24 00:08:22 +02:00
Nicolas Dusart
b7b316bae8 fix ABI breakage in syscall constants 2017-10-20 10:37:57 +02:00
bors
7e33065ce4 Auto merge of #812 - malbarbo:x32, r=alexcrichton
Initial fixes for linux x32

Tested with a local build of rustc. The main test can be compiled but fails to execute (receives SIGTRAP, which I think in this case indicates memory violation, I will open an issue in the rustc repo).

This PR is important because it fixes the definition of `c_long` and `c_ulong`. Without these fixes, rustc crash with the error:

```
Cannot emit physreg copy instruction
UNREACHABLE executed at /checkout/src/llvm/lib/Target/X86/X86InstrInfo.cpp:5778!
```

Related https://github.com/rust-lang/rust/issues/37976
2017-10-19 16:40:53 +00:00
bors
b06739dda9 Auto merge of #813 - ndusart:syscall-android, r=alexcrichton
SYS_* constants are of type long in Android

The SYS_* constants should be `c_long` as `syscall` expect a `c_long` as first argument and in Android headers, there is no sign that these constants should be `unsigned long`.

So the compilation targeting ARM Android fails for dependent crates using `syscall`.
2017-10-19 16:21:29 +00:00
bors
07088d2a0e Auto merge of #810 - oherrala:pthread_cancel, r=alexcrichton
Introduce pthread_cancel() for terminating threads

pthread_cancel() is safer way to terminate thread than pthread_kill().

This function can be found from ISO/IEC 9945-1:1996 (“POSIX.1”) and first introduced into Single Unix Specification version 2 on 1997.
2017-10-19 15:06:41 +00:00
bors
2172bb4bab Auto merge of #802 - Mic92:setfsuid, r=alexcrichton
add setfsgid/setfsuid on Linux
2017-10-19 14:37:21 +00:00
Joerg Thalheim
3406fe94fa provide setfsgid/setfsuid also on android 2017-10-19 11:00:43 +01:00
Nicolas Dusart
4b240a6b86 SYS_* constants are of type long in Android 2017-10-19 11:11:21 +02:00
Ossi Herrala
f024fe7dd3 Trying to fix for i686-apple
Error was "bad pthread_cancel function pointer: rust: 8362822 (0x7f9b46) != c 8358779 (0x7f8b7b)"
2017-10-19 11:00:37 +03:00
Bryant Mairs
6d55c2496d Add termios2 for Android & Linux
Note that termios2 doesn't exist on powerpc(64), termios
is used instead.
2017-10-18 21:14:43 -07:00
Bryant Mairs
12cfa1ef46 Add BOTHER to Android & Linux 2017-10-18 20:57:34 -07:00
Marco A L Barbosa
a5bd4b5668 Fix style 2017-10-18 21:20:18 -02:00
Marco A L Barbosa
1ff3817887 Move down c_long and c_ulong of linux/other/b64 to accommodate x32 2017-10-18 21:08:51 -02:00
Marco A L Barbosa
1994be3183 Linux x32 does not have some SYS_ constants 2017-10-18 21:08:51 -02:00
Marco A L Barbosa
343b7c15be Linux x32 does not support sysctl 2017-10-18 21:08:51 -02:00
Marco A L Barbosa
c3408c10e3 Fix utmpx.ut_session for linux x32 2017-10-18 21:07:36 -02:00
Marco A L Barbosa
bbc2cfa096 Fix timespec, stat, stat64 for linux x32 2017-10-18 21:07:36 -02:00
Marco A L Barbosa
477425435a Fix mq_attr for linux x32 2017-10-18 21:07:36 -02:00
Marco A L Barbosa
968bce4ed4 Fix c_long, c_ulong and sysinfo for linux x32 2017-10-18 21:07:36 -02:00
Alex Crichton
9029cfb9eb Add more Linux-based syscall tables
* Add syscall tables to most remaining arches in `src/unix/notbsd`
* Add aarch64/arm musl to CI
* Update dependencies
2017-10-18 15:17:00 -07:00
Ossi Herrala
fcc8237add Introduce pthread_cancel() for terminating threads
pthread_cancel() is safer way to terminate thread than pthread_kill().

This function can be found from ISO/IEC 9945-1:1996 (“POSIX.1”) and
first introduced into Single Unix Specification version 2 on 1997.
2017-10-18 15:53:10 +03:00
Dan Glastonbury
ebb59a27eb freebsd: Add LOCAL_* for local domain sockets. 2017-10-18 09:51:10 +10:00
Roberto Oliveira
65fc01a06f Add missing powerpc64 in musl/mod.rs
powerpc64 was missing in musl/mod.rs and making build fail
as it was not able to find types, like c_char.
2017-10-17 16:02:25 -02:00
bors
f001b8a43c Auto merge of #807 - djg:macos_sol_local, r=alexcrichton
Local peer credential support for Darwin.

Darwin uses SOL_LOCAL/LOCAL_PEERCRED instead of SOL_SOCKET/SO_PEERCRED parameters to getsocktopt to retrieve the credentials of a socket's peer.

(Documented in man 4 unix)
2017-10-17 14:16:51 +00:00
Joerg Thalheim
8c24117c63 define SYS_renameat2 + flags on linux
Motivation: there is no glibc wrapper for this syscall
2017-10-16 19:20:35 +01:00
Dan Glastonbury
49c97ba49c apple: Add SOL_LOCAL and LOCAL_* for local domain sockets. 2017-10-16 14:47:58 +10:00
Andrew Tunnell-Jones
611066a535 Add getprotobynumber 2017-10-13 23:06:02 +00:00
Andy Lowry
190135c862 Remove excess whitespace 2017-10-12 16:45:17 +01:00
Andy Lowry
df25142e39 Add ucred to musl 2017-10-12 16:31:03 +01:00
Alex Crichton
2bdbddcaae Add ucred on Android 2017-10-11 09:22:46 -07:00
Jonathan A. Kollasch
7a06a32e46 netbsd: add KERN_PROC_ARGS sysctl MIB subtypes 2017-10-07 15:13:21 -05:00
Andrew Tunnell-Jones
e0e08d1652 Add getservbyname and getprotobyname 2017-10-07 07:13:59 +00:00
bors
0c1608ab99 Auto merge of #792 - justinlatimer:ip-bindany, r=alexcrichton
Add IP_BINDANY for FreeBSD

Adds the IP_BINDANY constant for FreeBSD. Thanks!
2017-10-05 20:38:30 +00:00
Justin Latimer
1daf1c212a Add IP_BINDANY for FreeBSD 2017-10-05 20:24:56 +00:00
Sébastien Marie
e26a5d5630 add utimensat to netbsdlike 2017-10-05 06:16:35 +02:00
Joerg Thalheim
b103fae4af Add preadv64/pwritev64 on Linux/Android 2017-09-28 12:45:34 +01:00
Joerg Thalheim
df64b412a2 Add fstatat64 on Linux/Android 2017-09-27 11:44:50 +01:00
bors
5ee53b03f1 Auto merge of #782 - tjkirch:master, r=alexcrichton
Add support for aarch64-unknown-linux-musl

This adds support for aarch64-unknown-linux-musl as requested in rust-lang/rust#44779 by @alexcrichton

The new file `ci/docker/aarch64-unknown-linux-musl/Dockerfile` essentially merges the aarch64-unknown-linux-gnu and x86_64-unknown-linux-musl Dockerfiles.

The bigger changes are under `src/unix/notbsd/linux/`, though they're fairly superficial:

Previously, some constants could be shared between all 64-bit musl triples, but aarch64 differs, so a number of things were moved from `musl/b64/mod.rs` to specific arches: `musl/b64/powerpc64.rs` and `musl/b64/x86_64.rs`, with the aarch64-specific differences being added to `musl/b64/aarch64.rs`.

Similarly, some constants moved from `musl/mod.rs` to lower levels: `musl/b32/mod.rs`, `musl/b64/powerpc64.rs`, and `musl/b64/x86_64.rs`, with the aarch64-specific differences added to `musl/b64/aarch64.rs`.

Finally, some things that were true of all Linux builds moved from `mod.rs` into lower levels: `mips/mod.rs`, `other/mod.rs`, `musl/b32/mod.rs`, `musl/b64/powerpc64.rs`, and `musl/b64/x86_64.rs`, with the aarch64-specific differences added to `musl/b64/aarch64.rs`.

Testing:

All linux-based triples under `ci/docker` were run through `ci/run-docker.sh` successfully, which checks that the size and alignment of definitions match for each triple, among other tests.  (The local build of rust from rust-lang/rust#44779 was set for the aarch64-unknown-linux-musl build.)

I also confirmed that it has "good style!" according to `ci/style.rs`.
2017-09-25 22:34:56 +00:00
Tom Kirchner
b9fdcf9467 Add support for aarch64-unknown-linux-musl
Signed-off-by: Tom Kirchner <tjk@amazon.com>
Signed-off-by: Ben Cressey <bcressey@amazon.com>
2017-09-25 14:30:52 -07:00
bors
209468a673 Auto merge of #781 - jessicah:haiku-fixes-for-nix, r=alexcrichton
Haiku fixes for nix
2017-09-25 19:39:56 +00:00
Jessica Hamilton
0d822be88c unix: remove constants moved into submodules. 2017-09-26 06:35:52 +00:00
Jessica Hamilton
03ed3ff7a9 Move various POLL* and RTLD_LAZY constants into submodules.
Unfortunately, these differ on Haiku, and using #[cfg(...)] is
not allowed in unix/mod.rs.
2017-09-26 06:08:32 +00:00
Jessica Hamilton
086d575925 Revert "POLL*/RTLD_LAZY: definitions differ on Haiku."
This reverts commit f816434f9b.
2017-09-26 06:00:45 +00:00
Jessica Hamilton
f816434f9b POLL*/RTLD_LAZY: definitions differ on Haiku. 2017-09-26 04:09:54 +00:00
Jessica Hamilton
3c91010af0 haiku: add missing definitions found from building nix. 2017-09-26 04:02:03 +00:00
Jessica Hamilton
ee8a490e06 haiku: add openpty/forkpty, and link to libbsd. 2017-09-26 01:01:22 +00:00
Jessica Hamilton
6de9e63431 haiku: define PATH_MAX. 2017-09-26 00:06:28 +00:00
Jessica Hamilton
72ac033a4a haiku: fix incorrect constant for EMFILE. 2017-09-26 00:06:14 +00:00