Commit Graph

2282 Commits

Author SHA1 Message Date
Josh Triplett 3e9945eb04
Merge pull request #1897 from Aaron1011/feature/sys-pidfd-open-clone3
Add SYS_pidfd_open and SYS_clone3
2020-09-30 20:14:47 -07:00
Alistair Francis c6c9181874 unix: riscv32: Fix CI failure
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-30 18:58:05 -07:00
Alistair Francis 6801218fd4 linux: riscv32: Add support for the 64-bit time_t RV32 glibc port
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-30 07:29:38 -07:00
Yuki Okushi 9c17cad7f0
Merge pull request #1899 from joshtriplett/support-static-glibc 2020-09-30 17:18:45 +09:00
Yuki Okushi b3f8975d3e
Merge pull request #1903 from bartelsielski/master
Add struct ip_mreqn to more Linux targets
2020-09-30 15:47:38 +09:00
Yuki Okushi bffed84b3f
Merge pull request #1904 from glaubitz/sparc-linux
Fix type definition for c_char on sparc-unknown-linux-gnu
2020-09-30 12:43:57 +09:00
Yuki Okushi 8cdddfd6b8
Merge pull request #1905 from qwandor-google/vsock
Android: Add vsock constants and struct.
2020-09-30 12:40:51 +09:00
Andrew Walbran 37357abbfc Android: Add vsock constants and struct. 2020-09-29 13:41:00 +01:00
John Paul Adrian Glaubitz 772a3acfa6 Fix type definition for c_char on sparc-unknown-linux-gnu
On sparc-unknown-linux-gnu, char is signed, not unsigned.
2020-09-27 23:27:30 +02:00
Bartel Sielski f64da93c68 Add struct ip_mreqn to more Linux targets
Support was previously added to gnu x86_64 and all musl targets but
others were not included because of a roundtrip issue [1].

This commit adds support for the ip_mreqn struct on all Linux GNU
targets which did not have the roundtrip issue.

[1]: https://github.com/rust-lang/libc/issues/1558

Signed-off-by: Bartel Sielski <bartel.sielski@gmail.com>
2020-09-25 15:50:23 +02:00
Josh Triplett 5bf6ee5d8e Consolidate handling of libdl, and handle crt-static
Move the link line for `libdl` up to `src/unix/mod.rs`, making it easier
to see all the libraries `libc` links to.

This also makes `libdl` respect `target-feature=+crt-static`.
2020-09-21 01:15:03 -07:00
Josh Triplett e005f4cad5 Consolidate handling of libutil, and handle crt-static
The two library blocks that specify `#[link(name = "util")]` do not
actually reference any functions in `libutil`; the functions that do use
`libutil` don't have any reference to it. And having two library blocks
specify it results in two separate inclusions of `-lutil` on the linker
command line. Move the link lines up to `src/unix/mod.rs`, making it
easier to see all the libraries `libc` links to.

This also makes `libutil` respect `target-feature=+crt-static`.
2020-09-21 01:15:00 -07:00
Josh Triplett ac0a783953 Add support for building with static glibc
This will need corresponding changes in rust-lang/rust to activate, but
this will make it possible to make those changes.

Note that despite the apparent redundancy in config directives, the link
directives cannot be simplified any further. Attempting to factor out
the checks for `target_feature = "crt-static"` does not work.
2020-09-21 01:14:06 -07:00
Aaron Hill 8e58e82c02
Add SYS_pidfd_open and SYS_clone3
These syscalls were added recently, and therefore have consistent
numbers across different architetures (other than the weird offsetting
on some platforms).
2020-09-17 06:05:23 -04:00
Matt Schulte d66df29623 Add UIO_MAXIOV constant to uclibc
!1880 added UIO_MAXIOV to libc, but did not add it to uclibc. This
causes build breaks for std against uclibc.
2020-09-16 21:28:07 -07:00
Daniil Bondarev 773f5562ba Use safe_f! consistently across platforms
The pr #1870 introduced safe_f! macro, which made some functions like
WIFEXITED and WEXITSTATUS const and safe on linux_like platform only,
which causes inconsistency when trying to use those functions in crates
compiled across multiple platforms, as using unsafe on those functions
will generate unused_unsafe warning on linux platforms and lack of
unsafe block will fail compilation on non-linux platforms.

To avoid the inconsistency, this commit applies the same macro for all
the same functions on other platforms too.
2020-09-12 23:38:06 -07:00
LinkTed c6e695f3fa Add more constants for Linux like OS 2020-09-11 19:25:05 +02:00
Yuki Okushi 59544d95bc
Merge pull request #1887 from psumbera/master
add pthread_getattr_np() and pthread_attr_getstack() for Solaris
2020-09-10 14:11:16 +09:00
Petr Sumbera 9f6a7ceee8 add pthread_getattr_np() and pthread_attr_getstack() support for illumos and Solaris systems 2020-09-09 16:30:56 +02:00
MeiK 7cc22dbabd Add getitimer and setitimer for macOS
Add getitimer and setitimer for macOS
2020-09-03 18:31:25 +08:00
Yuki Okushi af7749c1e5
Merge pull request #1882 from alindima/master
Add missing syscall numbers for aarch64-musl
2020-09-02 13:41:23 +09:00
Yuki Okushi d21380bb50
Merge pull request #1881 from JohnColanduoni/apple-o-symlink
Add support for Apple's O_SYMLINK flag
2020-09-02 13:36:04 +09:00
Yuki Okushi f19436de85
Merge pull request #1880 from Thomasdezeeuw/io-max-consts
Add IOV_MAX and UIO_MAXIOV constants
2020-09-02 13:34:08 +09:00
Yuki Okushi 75ab4a0124
Merge pull request #1875 from cmusser/master 2020-09-02 13:31:54 +09:00
alindima a75f9347e1 Add missing syscall numbers for aarch64-musl 2020-08-31 11:03:01 +03:00
John Colanduoni abd18481b7 Add support for Apple's O_SYMLINK flag 2020-08-29 19:41:16 -07:00
Thomas de Zeeuw 41fb480527 Add IOV_MAX and UIO_MAXIOV constants
These constant can be used to determine the maximum number of iovecs can
be passed to functions like readv/writev.

Linux like uses UIO_MAXIOV, while the BSD family uses IOV_MAX.
2020-08-28 15:03:50 +02:00
Chuck Musser 2e3748a53c Restore the __error() function, but add a deprecation warning. 2020-08-23 19:23:21 -07:00
Chuck Musser c354c216ff Dragonfly: expose __errno_location() rather than define __error().
Expose __errno_location() (introduced in DragonFlyBSD 5.8), which
returns the current thread's errno value. This is similar to Linux
and avoids having a separate module that defines both errno (which
depends on the thread_local feature) and an __error() function.
2020-08-23 09:37:00 -07:00
Niels Sascha Reedijk 43ad09ee63 Haiku: add [get/set]priority()
These methods were added in Haiku R1 beta 2.
2020-08-22 21:57:11 +00:00
Daniil Bondarev ce5cb03544 Added clock_getcpuclockid to more targets
Previously clock_getcpuclockid was enabled only on linux, with this
change it is enabled on all linux_like and freebsdlike.
2020-08-21 22:12:48 -07:00
Yuki Okushi ace7ba86e5
Merge pull request #1870 from joshtriplett/safe-functions 2020-08-21 04:23:12 +09:00
Josh Triplett 5a1df22a78 Make some inline functions like WIFEXITED and WEXITSTATUS const and safe 2020-08-19 23:32:39 -07:00
Josh Triplett b1144cc924 libc can't use derive(Copy,Clone) because it doesn't work in rustc 2020-08-19 22:58:10 -07:00
Jed Brown 3f9f49aacd add fmemopen, open_memstream, and open_wmemstream for POSIX.1-2008
Skip test on aarch64 due to https://github.com/rust-lang/libc/issues/1765
2020-08-19 19:08:00 -06:00
Yuki Okushi 50318f7665
Merge pull request #1863 from ifreund/aarch64-musl-ucontext_t
Add ucontext_t for aarch64-unknown-linux-musl
2020-08-20 04:25:29 +09:00
Isaac Freund 2259b0b154
Add ucontext_t for aarch64-unknown-linux-musl 2020-08-19 10:18:21 +02:00
Yuki Okushi b1793090f4
Merge pull request #1861 from joshtriplett/p_pidfd 2020-08-19 07:45:41 +09:00
Josh Triplett e709b3f78a Define P_PIDFD, used with waitid
Linux defines a waitid type `P_PIDFD`, for use with process file
descriptors (`pidfd`). Add that constant.

In libc-test, add linux/wait.h to the Linux-specific and
Android-specific headers, to get the definition. Exclude it on Android
and musl for now, though, as the versions in CI don't have it yet.
2020-08-18 14:11:08 -07:00
Yuki Okushi c6c865ef5e
Merge pull request #1862 from fornwall/android-regex 2020-08-17 00:06:30 +09:00
Yuki Okushi 83b3730444
Merge pull request #1859 from joshtriplett/w_exitcode 2020-08-14 15:50:20 +09:00
Fredrik Fornwall faecad7f01 Expose regex.h for Android 2020-08-12 10:17:18 +02:00
Yuki Okushi 6ff0689d88
Merge pull request #1858 from joshtriplett/siginfo-pid-uid
Expose si_pid and si_uid from siginfo_t as functions
2020-08-11 16:05:55 +09:00
Yuki Okushi 67005e0625
Merge pull request #1860 from joshtriplett/cld
Add CLD_ constants
2020-08-11 15:59:18 +09:00
Josh Triplett 57298d0637 Add W_STOPCODE to construct a stop code
On Linux, `sys/wait.h` defines a `W_STOPCODE` macro to construct a stop
code from the signal number of a stopping signal. Provide an equivalent
function.

Suggested-by: Ivan Tham <pickfire@riseup.net>
2020-08-10 20:23:03 -07:00
Josh Triplett a4178c59ee siginfo: Provide functions for si_utime and si_stime
The SIGCHLD variant of the siginfo structure also provides fields for
user and system time; expose those as well.
2020-08-10 20:20:30 -07:00
Josh Triplett e3bce7511b siginfo: In the struct used to access sifields, don't name the first 3 fields
The first 3 fields of `siginfo_t` have different orders on MIPS. When
casting `siginfo_t` to a different type to access the fields of the
`sifields` union, avoid giving names to the first three fields, since
they're only present for memory layout and shouldn't be accessed from
the casted structure type.
2020-08-10 20:16:50 -07:00
Josh Triplett 13d0cdb68f Expose si_pid, si_uid, and si_status from siginfo_t as functions
On Linux, siginfo_t cannot expose these fields directly due to
https://github.com/rust-lang/libc/issues/716 , so expose them as
functions, just like si_addr and si_value.

In order to get alignment correct on both 32-bit and 64-bit
architectures, define an sifields union that includes a pointer field,
to ensure that it has the same alignment as a pointer.
2020-08-10 01:24:22 -07:00
Josh Triplett 220505181f Add CLD_ constants
These constants appear in the si_code field of a SIGCHLD signal or
waitid-returned siginfo value.
2020-08-09 16:59:09 -07:00
Josh Triplett 631da86c92 Add W_EXITCODE to construct an exit code
On Linux, `sys/wait.h` defines a `W_EXITCODE` macro to construct an exit
code from a return value and a signal number. Provide an equivalent
function.
2020-08-09 16:40:54 -07:00
Fábio Botelho 8ced4c0a8c Add mac/ios pthread_from_mach_thread_np
Allows us to get a pthread id from a match thread id.
From pthread.h [1]:

```
__API_AVAILABLE(macos(10.5), ios(2.0))
_Nullable pthread_t pthread_from_mach_thread_np(mach_port_t);
```

[1] - https://opensource.apple.com/source/libpthread/libpthread-416.40.3/pthread/pthread.h.auto.html
2020-08-09 18:17:08 +01:00
Yuki Okushi ab3c229140
Merge pull request #1854 from jclulow/illumos-openpty
add openpty and forkpty implementation for illumos systems
2020-08-07 06:28:47 +09:00
Joshua M. Clulow 1f0ea0da73 add openpty and forkpty implementation for illumos systems
At time of writing, illumos systems do not provide an implementation of
the openpty() and forkpty() wrappers provided on some other UNIX
systems.  While we expect to grow an implementation, it seems prudent to
provide a compatibility routine here first to unblock illumos support in
the popular nix crate.
2020-08-05 20:39:45 -07:00
Dark Kirb e9a1268320 Add DevkitPPC support
DevkitPPC does not support unix sockets natively, meaning that bindings
to these functions was removed for powerpc targets with "nintendo" as
vendor.

Suggested target json files:

Nintendo Gamecube:
```
{
  "arch": "powerpc",
  "data-layout": "E-m:e-p:32:32-i64:64-n32",
  "dynamic-linking": false,
  "env": "newlib",
  "executables": true,
  "has-elf-tls": false,
  "has-rpath": true,
  "linker-flavor": "gcc",
  "llvm-target": "powerpc-eabi",
  "max-atomic-width": 32,
  "os": "dolphin",
  "target-c-int-width": "32",
  "target-endian": "big",
  "target-family": "unix",
  "target-mcount": "_mcount",
  "target-pointer-width": "32",
  "vendor": "nintendo"
}
```

Nintendo Wii:
```
{
  "arch": "powerpc",
  "data-layout": "E-m:e-p:32:32-i64:64-n32",
  "dynamic-linking": false,
  "env": "newlib",
  "executables": true,
  "has-elf-tls": false,
  "has-rpath": true,
  "linker-flavor": "gcc",
  "llvm-target": "powerpc-eabi",
  "max-atomic-width": 32,
  "os": "revolution",
  "target-c-int-width": "32",
  "target-endian": "big",
  "target-family": "unix",
  "target-mcount": "_mcount",
  "target-pointer-width": "32",
  "vendor": "nintendo"
}
```
2020-08-05 08:19:48 +01:00
Yuki Okushi 510badd75f
Merge pull request #1853 from coolreader18/nameinfo-consts
Add more constants for getnameinfo on android
2020-08-05 05:29:30 +09:00
coolreader18 ec5c0ae6bc Add more constants for getnameinfo 2020-08-02 14:49:54 -05:00
Joshua M. Clulow 1c9d5eaa41 add ucred(3C) support for illumos and Solaris systems
This series of routines allows the caller to determine the credentials
of another process by pid, or of the process on the remote end of a UNIX
domain socket.  The ucred_t is an opaque object with accessor routines,
and must be freed through ucred_free(3C) after use.
2020-08-01 21:47:13 -07:00
Nikita Baksalyar 5d2f261ab9 Add sys/personality.h constants for Linux 2020-07-29 01:45:44 +01:00
Alan Somers 554ea4b8bd Deprecate CTL_P1003_1B_MAXID
It's been removed in FreeBSD 13 (svn r363622), and never had any
legitimate use outside of the base system anyway.
2020-07-27 14:59:32 -06:00
Yuki Okushi f944fce982
Merge pull request #1834 from GabrielMajeri/ptrace-event-stop
Add `PTRACE_EVENT_STOP`
2020-07-26 05:03:07 +09:00
Gabriel Majeri c78e0b82e1 Add `PTRACE_EVENT_STOP` 2020-07-25 20:36:22 +03:00
Bryan Donlan da16adf57b Expose IP_FREEBIND constant for linux 2020-07-24 18:27:30 +00:00
Yuki Okushi b2e250e3bd
Merge pull request #1831 from xonatius/patch-1 2020-07-24 17:03:56 +09:00
Daniil Bondarev 482420f63d
Fixed style suggestion
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2020-07-23 16:28:11 -07:00
Yuki Okushi 65be52f339
Merge pull request #1830 from JohnTitor/utmpx
Declare `utmpx` on musl
2020-07-24 04:45:34 +09:00
Daniil Bondarev 42bb28d615 Added clock_getcpuclockid to linux
https://man7.org/linux/man-pages/man3/clock_getcpuclockid.3.html
2020-07-21 23:48:04 -07:00
Yuki Okushi 05c4574f3a
Declare `utmpx` on musl 2020-07-22 09:51:21 +09:00
Yuki Okushi dce0ec0adb
Merge pull request #1828 from stefano-garzarella/vsock-vmaddr-local 2020-07-21 08:07:53 +09:00
Stefano Garzarella e93797a689 linux: add VMADDR_CID_LOCAL
In Linux we replaced VMADDR_CID_RESERVED with VMADDR_CID_LOCAL
in commit ef343b35d46667668a099655fca4a5b2e43a5dfe.
It is available since Linux v5.6, and it can be used to do
local communication if supported.

This patch deprecates VMADDR_CID_RESERVED for backward
compatibility.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2020-07-20 21:33:00 +02:00
Dan Gohman 351c435814 Add a declaration for `posix_fadvise64` on Linux.
As with the other *64 functions in Linux, `posix_fadvise64` is like
`posix_fadvise` but uses `off64_t` instead of `off_t`.
2020-07-20 07:42:25 -07:00
Simonas Kazlauskas 91fee24f12
Move the SEAL constants to freebsd12 module 2020-07-20 01:16:47 +09:00
Simonas Kazlauskas 6b14cfbf93
Add some missing fcntl flags for freebsd 2020-07-20 01:14:26 +09:00
Patrick Mooney e1b9757128 Expose EPOLLEXCLUSIVE on illumos platform
Initially the EPOLLEXCLUSIVE definition was hidden on the illumos
platform as it lacked explicit support.  After further review, it was
concluded that EPOLLEXCLUSIVE can safely be considered a no-op, when not
fully implemented by the OS, making it safe for use on illumos.
2020-07-17 18:28:33 +00:00
Yuki Okushi 68e1fd8faa
openbsd: Fix `WIFSTOPPED` following upstream
b66614995a/sys/sys/wait.h (L52)
2020-07-15 01:39:07 +09:00
Simon Wörner fabdb14a0c added ptrace_vm_entry struct 2020-07-10 01:28:40 +02:00
Simon Wörner 2ea1dee37b added ptrace io struct and defines 2020-07-09 17:31:15 +02:00
Jake Goulding 8c2daaea67 Limit macOS `$INODE64` symbol names to x86 and x86_64
The new ARM-based platform doesn't need these as there's no legacy
constraints.

Tested via

**demo.c**

```c

int main() {
  fstat(0, NULL);
  fstatat(0, NULL, NULL, 0);
  lstat(NULL, NULL);
  stat(NULL, NULL);
  readdir(NULL);
  readdir_r(NULL, NULL, NULL);
}
```

**Compilation**

```none
% SDKROOT=/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk MACOSX_DEPLOYMENT_TARGET=11.5 cc -arch arm64 demo.c

% nm a.out
0000000100008030 d __dyld_private
0000000100000000 T __mh_execute_header
                 U _fstat
                 U _fstatat
                 U _lstat
0000000100003e64 T _main
                 U _readdir
                 U _readdir_r
                 U _stat
                 U dyld_stub_binder
```

This has also been experimentally compiled on a Developer Transition Kit.
2020-07-08 07:27:40 -04:00
Alan Somers 6f2139e1c4 Fix _ALIGNBYTES on FreeBSD x86 with Rust <= 1.23.0.
Fixes #1775
2020-07-07 14:16:25 -06:00
Greg V 962b984773 FreeBSD: new rand()/srand() ABI in 13
https://reviews.freebsd.org/rS357382
2020-07-06 15:31:37 +03:00
Greg V 9fc2574548 FreeBSD: chase CTL_UNSPEC to CTL_SYSCTL, IPPROTO_SEP to IPPROTO_DCCP renames
Plus, add new constants for sysctls that give names to existing magic numbers.

https://reviews.freebsd.org/rS350749
https://reviews.freebsd.org/rS352486
2020-07-06 15:31:37 +03:00
Greg V 9340bb3516 FreeBSD: add mcontext_t/ucontext_t (only amd64 for now) 2020-07-06 15:31:37 +03:00
Greg V 1366bda058 FreeBSD: make wchar_t unsigned on arm/aarch64
Wide chars are unsigned when normal chars are
2020-07-06 15:31:37 +03:00
Greg V 45e7b8bef4 FreeBSD: fix SIGSTKSZ on arm/aarch64 / add MINSIGSTKSZ 2020-07-06 15:31:37 +03:00
Greg V e9a75ddd76 FreeBSD: use stat header in freebsd11/freebsd12 on aarch64
sys/stat.h is a machine-independent header, but it has ifdefs for i386.
The version that was called x86_64.rs should be used on powerpc64 too,
but I don't have a machine to test that on.
2020-07-06 15:31:37 +03:00
Greg V 8c23f77704 freebsdlike: move aio_ and mq_ functions to #[link(name = "rt")]
I just got 'libxul.so: Undefined symbol "mq_close"' when rebuilding Firefox..
How did no one catch this before??

This is correct for both FreeBSD and DragonFly:
https://github.com/freebsd/freebsd/blob/master/lib/librt/Symbol.map
e7ab884bd4/lib/librt/mq.c
e7ab884bd4/lib/librt/aio.c
2020-07-06 15:31:37 +03:00
Marcin Konicki c17a4c1711
Add missing sysconf constants for Haiku
Hi,

Could you add some missing Haiku constants (i'm guessing they were added after Haiku port was last updated)?

These are defined in `unistd.h`: 194a45c6b4/headers/posix/unistd.h (L134-L137)
2020-07-03 22:09:46 +02:00
Yuki Okushi 7a507b64c2
Merge pull request #1806 from alexcrichton/aarch64-mcontet
Add ucontext_t/mcontext_t for aarch64 Android
2020-07-03 11:25:35 +09:00
Yuki Okushi fdc5cf4a1b
Merge pull request #1750 from asomers/super_magic 2020-07-03 11:09:29 +09:00
Alan Somers c9b8fc8305 Add more *_SUPER_MAGIC defines from the latest Linux kernel 2020-07-02 18:34:48 -06:00
Alex Crichton 8059eda19d Add ucontext_t/mcontext_t for aarch64 Android
This ended up just getting copied from Linux as it appears to be the
same.
2020-07-02 09:33:15 -07:00
Yuki Okushi bfb1b1301d
Add some syscalls from `fs/open.c` on linux/aarch64 2020-07-02 19:02:42 +09:00
kolapapa b672d88e53 add uclibc `SOCK_RDM` field 2020-07-01 12:14:33 +08:00
Andrew Walbran 51acd7f488 Android: Add various constants and functions.
In particular:
Add timerfd constants and functions, from sys/timerfd.h.
Add EFD_SEMAPHORE and group all EFD_ constants together.
Add sigtimedwait function, from signal.h.
Add missing fallocate constants and functions, from linux/falloc.h and fcntl.h.
Add xattr functions, from sys/xattr.h.
Add SCHED_ and SEEK_ constants, from linux/sched.h and bits/seek_constants.h.
Add rlimit functions, from sys/resource.h.
Add RENAME_ constants, from stdio.h.
Add ino64_t type, from sys/types.h.
2020-06-30 17:56:11 +01:00
Andrew Walbran 5f0466501c Android: Update to latest version of NDK. 2020-06-30 17:56:11 +01:00
Alan Somers 1d68e9aa69 Sort linux's *_SUPER_MAGIC definitions 2020-06-30 08:25:08 -06:00
Yuki Okushi b6396caf31
Merge pull request #1792 from jasonbking/cmsg 2020-06-27 19:17:32 +09:00
Jason King 40c46f4306 Add ancillary socket data accessor functions for solarish OSes 2020-06-26 20:58:43 +00:00
Yuki Okushi 3118fb455e
Merge pull request #1793 from reitermarkus/xtensa-support-master
Add `MSG_` constants for Xtensa.
2020-06-23 19:15:50 +09:00
Simon Wörner 4a9413ba54 added freebsd register structs 2020-06-22 17:33:09 +02:00
Markus Reiter 156f82c216 Add `AF_INET6` for Xtensa. 2020-06-22 08:30:36 +02:00
Markus Reiter 82453b3c3f Add `MSG_` constants for Xtensa. 2020-06-22 07:23:17 +02:00
Patrick Mooney b53ccb8740 illumos: Add eventfd support 2020-06-09 20:57:33 +00:00
Patrick Mooney 714ab82741 solarish: Add missing constants 2020-06-08 17:26:40 -05:00
Brian Cain e6dc360605 linux hexagon: add missing defines
This commit defines ETIMEDOUT, SIGSTKSZ, MINSIGSTKSZ
2020-06-04 11:02:28 -05:00
Yuki Okushi 5c033e0db1
Add `ip_mreqn` on the more targets 2020-05-29 09:40:24 +09:00
Yuki Okushi 42393b7d38
FreeBSD: Follow upstream `WIFSIGNALED` change 2020-05-29 04:27:57 +09:00
Joshua M. Clulow 9fdd9907ad remove SmartOS constants not applicable to illumos or Solaris
SmartOS is a downstream distribution of illumos, and carries a number of
additional patches that are not commonly available in other illumos
distributions.  They are also not found in Oracle Solaris.  With these
removed, the libc tests pass on a stock illumos system running
OpenIndiana.
2020-05-26 21:55:30 -07:00
Yuki Okushi 012444055e
Merge pull request #1748 from reitermarkus/xtensa-support
Add types for newlib on Xtensa.
2020-05-25 17:58:33 +09:00
Yuki Okushi 967dffee51
Add `TCP_KEEP{INTVL,CNT}` to macOS 2020-05-25 14:01:49 +09:00
Joshua Abraham 1a7678933e linux: ptrace: Add definition for PTRACE_SYSEMU/_SINGLESTEP 2020-05-23 09:39:47 -04:00
Markus Reiter a422e34ca8 Add explanation for `ai_addr` field. 2020-05-22 06:56:55 +02:00
Markus Reiter 0dec549f8d Add types for newlib on Xtensa. 2020-05-22 06:56:55 +02:00
Yuki Okushi 78ba4b4ee4
Deprecate `KERN_USERMOUNT` and `KERN_ARND` in 0.2.71 2020-05-22 13:36:27 +09:00
Yuki Okushi e74204347f
Merge pull request #1770 from JohnTitor/fix-prio-which
Re-define `__priority_which`s as c_uint in linux-gnu
2020-05-22 09:24:11 +09:00
Yuki Okushi f9f56830f8
Re-define `__priority_which`s as c_uint in linux-gnu 2020-05-21 21:57:46 +09:00
Valdemar Erk 5fec4c3691 [FreeBSD] Add missing getnameinfo() flag values.
This patchs adds missing flag values for getnameinfo()
on FreeBSD, the following flags have been added from
the FreeBSD tree.

 /*
  * Flag values for getnameinfo()
  */
 #define	NI_NOFQDN	0x00000001
 #define	NI_NUMERICHOST	0x00000002
 #define	NI_NAMEREQD	0x00000004
 #define	NI_NUMERICSERV	0x00000008
 #define	NI_DGRAM	0x00000010
 #define	NI_NUMERICSCOPE	0x00000020

Signed-off-by: Valdemar Erk <valdemar@erk.io>
2020-05-21 14:38:13 +02:00
Yuki Okushi 174920c79f
Merge pull request #1760 from Susurrus/tiocbrk_android
Add TIOC*BRK constants for Android
2020-05-19 07:05:01 +09:00
Bryant Mairs 833c6b5c06 Add tioc*brk constants for Android 2020-05-18 08:19:13 -07:00
Xavier L'Heureux d573a99525
Add extra functions & constants from sys/mman.h for Redox 2020-05-18 10:08:12 -04:00
Bryant Mairs 524ec8f2f5 Add TIOCSBRK/TIOCCBRK to more supported platforms
Reorganized some constants as well so they're grouped a bit better.
2020-05-07 10:56:44 -07:00
Bryant Mairs d44f9b7ef9 Reorder consts for sparc64 to match header 2020-05-07 10:56:44 -07:00
Yuki Okushi c2555851fe
Merge pull request #1747 from wg/master
Define IPV6_CHECKSUM & IPV6_HOPLIMIT on more platforms
2020-05-03 15:22:28 +09:00
Yuki Okushi 2020fddd38
Merge pull request #1684 from JohnTitor/riscv64
Add `riscv64gc-unknown-linux-gnu` image
2020-05-03 14:41:25 +09:00
Niels Sascha Reedijk 080a57f805 Haiku: fix name of AF_UNSPEC 2020-05-02 09:17:44 +00:00
Will 00327ab0b9 define IPV6_HOPLIMIT for freebsd, linux, and macos 2020-05-01 14:30:45 +09:00
Will a875141356 define IPV6_CHECKSUM for freebsd and macos 2020-05-01 14:29:46 +09:00
Yuki Okushi bf5d83816f
Make some fields private 2020-04-30 14:26:40 +09:00
Yuki Okushi 4984947eab
Remove the re-definition of `timespec` 2020-04-30 13:21:43 +09:00
Yuki Okushi 32184239e0
Merge pull request #1745 from msizanoen1/riscv-add-constants
Add RLIMIT_* constants for RISC-V 64-bit GNU/Linux and minor fixes for type definitions
2020-04-29 15:48:36 +09:00
Robert Collins 5f28e11719 Fix #1670 missing RLIMIT_AS etc on android
Signed-off-by: Robert Collins <robertc@robertcollins.net>
2020-04-29 12:02:04 +12:00
msizanoen1 938ad95f48 Add RLIMIT_* constants for RISC-V 64-bit GNU/Linux 2020-04-25 18:55:09 +07:00
msizanoen1 af181f0dcf Remove redundant type definitions for RISC-V 64-bit GNU/Linux 2020-04-25 15:45:15 +07:00
Yuki Okushi 1da0baa684
Merge pull request #1741 from kubo39/patch-CPU_ALLOC_SIZE
Add CPU_ALLOC_SIZE
2020-04-16 09:52:55 +09:00
Hiroki Noda be0f98a78e Add CPU_ALLOC_SIZE
Co-Authored-By: Yuki Okushi <huyuumi.dev@gmail.com>
2020-04-16 07:16:48 +09:00
Greg V d8764e8b78 freebsd: add sockcred/SOCKCREDSIZE
Like on NetBSD, but without a pid field in the struct.
2020-04-15 14:55:55 +03:00
Greg V e687a59c8a freebsdlike: add SCM_CREDS
It is present on both FreeBSD and DragonFly
2020-04-15 14:55:55 +03:00
Yuki Okushi e0fc936d86
Merge pull request #1739 from kubo39/patch-CPU_COUNT
Add CPU_COUNT/CPU_COUNT_S
2020-04-15 07:35:38 +09:00
Hiroki Noda 94208c6eb2 Add CPU_COUNT/CPU_COUNT_S
revenge of #598
2020-04-15 04:42:48 +09:00
Yuki Okushi d1dd244318
Merge pull request #1736 from JohnTitor/rtentry
Add `rtentry` to musl
2020-04-15 02:43:22 +09:00
Yuki Okushi 7d75ee2a51
Add `rtentry` to musl as well 2020-04-14 23:35:01 +09:00
Sébastien Marie bc0f2ae606 REG_ENOSYS is NetBSD specific 2020-04-14 11:35:06 +00:00
Yuki Okushi 542eef19b9
Fix `max_align_t` size and align 2020-04-14 02:48:35 +09:00
Yuki Okushi c1a4d6271d
Use wasi values for `errno`s 2020-04-14 02:48:35 +09:00
Yuki Okushi 3d8197ec2b
Update links 2020-04-14 02:48:34 +09:00
Yuki Okushi 4eb6331c4f
Remove `TCP_FASTOPEN_CONNECT` from emscripten 2020-04-14 02:48:34 +09:00
Yuki Okushi be0347bbec
Remove `IPV6_FLOWINFO` from emscripten 2020-04-14 02:48:34 +09:00
Yuki Okushi 3a12831879
Remove some items defined in `errqueue.h` from emscripten 2020-04-14 02:48:31 +09:00
Yuki Okushi 12c28abe7b
Merge pull request #1729 from JohnTitor/license
Remove license headers
2020-04-14 00:26:28 +09:00
Alexander Batischev fda521b9d2 Add bindings for POSIX regexes
Headers I used:

Oh, for reference, here are the headers I used while working on this:

- musl: https://git.musl-libc.org/cgit/musl/tree/include/regex.h?id=8327ae0cb23b799bc55a45e0d4bd95f5a2b1cdf1
- glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=posix/regex.h;h=87cce7f5cb8cc3b678467329b479bd511e250e61;hb=HEAD
- macOS: https://opensource.apple.com/source/Libc/Libc-997.90.3/include/regex.h.auto.html
- FreeBSD: 8103b0ddb0/include/regex.h
- NetBSD: 61c8f6fbb7/include/regex.h
2020-04-13 15:57:58 +03:00
Matthias Schiffer 3913f5c4ec
unix: add strndup()
Add strndup(), as specified by POSIX.1-2008.
2020-04-11 17:05:39 +02:00
Yuki Okushi 545c62f7d4
Remove license headers 2020-04-11 23:35:45 +09:00
Yuki Okushi 9782b7ff8f
Merge pull request #1716 from pfmooney/illumos-target
Split up Solaris and illumos targets
2020-04-11 19:09:29 +09:00
Yuki Okushi 035a480942
Merge pull request #1728 from alexcrichton/add-ucontext
Add definition of ucontext_t for aarch64-unknown-linux-gnu
2020-04-11 11:52:28 +09:00
Alex Crichton 17d5bc841b Add definition of ucontext_t for aarch64-unknown-linux-gnu 2020-04-10 11:15:06 -07:00
Guillume DIDIER c646f96fdf This adds the defines from include/uapi/asm-generic/hugetlb_encode.h and the corresponding defines in include/uapi/linux/mman.h to linux_like/linux/gnu/mod.rs and the equivalent for musl in linux_like/linux/musl/mod.rs
Solves #1700

Removes two defines from musl/b32/hexagon.rs that are now provided two mudules "up"
2020-04-09 18:10:27 +02:00
Brian Gavin 106dcc2d1a Add strsignal(3) to unix
This does not add sys_siglist because the docs specify that the function
should be used instead, whenever possible.
2020-04-07 17:00:20 -04:00
Yuki Okushi 8764410c8e
Merge pull request #1720 from glebpom/linux-udp-constants
Add Linux UDP constants
2020-04-08 03:29:50 +09:00
Yuki Okushi f1ad2f5806
Merge pull request #1717 from jclulow/illumos-cfmakeraw
fix cfmakeraw() for illumos and Solaris
2020-04-08 01:37:32 +09:00
Gleb Pomykalov 1b4ef504fd Add Linux UDP constants 2020-04-06 21:15:06 +03:00
Daniel McCarney 5c7a82a1c8 linux: add fanotify(7) API bindings.
The `fanotify` API[0] is a linux-specific API for notification and interception
of filesystem events. In some ways it is similar to `inotify`, but with
different advantages/tradeoffs. It is particularly well suited to full
filesystem/mount monitoring (vs per directory) and for allowing/denying access
to files (`inotify` lacks this capability).

The `fanotify` API has been updated several times since it was enabled in Linux
2.6.37. Presently I've only included support for the original `fanotify`
features, and the `FAN_MARK_FILESYSTEM` addition made in Linux 4.20. There are
subsequent updates in 5.0 and 5.1 not covered in this initial commit.

This commit adds the relevant constants and types from
`uapi/linux/fanotify.h`[1] and two new functions (`fanotify_init`[2] and
`fanotify_wrap`[3]) to `src/unix/linux_like/linux/mod.rs`. While I believe this
API is also present on Android I have presently limited my attention to Linux.

Although this commit focuses on Linux 4.20.x's `fanotify` API/constants I have
skipped adding constants for `FAN_ALL_CLASS_BITS`, `FAN_ALL_INIT_FLAGS`,
`FAN_ALL_MARK_FLAGS`, `FAN_ALL_EVENTS`, `FAN_ALL_PERM_EVENTS` and
`FAN_ALL_OUTGOING_EVENTS` even though they are present in this kernel version's
headers. These defines were deprecated[4] in later releases with instructions to
not use them in new programs or extend them with new values. It would be a shame
for new Rust programs to use deprecated #defines!

[0]: http://man7.org/linux/man-pages/man7/fanotify.7.html
[1]: d54f4fba88/include/uapi/linux/fanotify.h
[2]: http://man7.org/linux/man-pages/man2/fanotify_init.2.html
[3]: http://man7.org/linux/man-pages/man2/fanotify_mark.2.html
[4]: 23c9deeb32 (diff-4c9ca62be6bf38cc08f7ea9daf16e379)
2020-04-04 16:07:09 -04:00
Joshua M. Clulow 5b6a3335ca fix cfmakeraw() for illumos and Solaris
This change fixes two issues.  First, the current cfmakeraw()
implementation in this crate appears to be making a stack copy of the
input "struct termios" before modifying it, rather than correctly
modifying the original through the pointer.  Before this modification
the routine did not, thus, set the flags for raw mode.

Second, we address the default settings of the MIN and TIME terminal
options.  On at least FreeBSD and Linux systems, the modern default
value for MIN appears to be 1; i.e., block and wait for at least one
input byte.  On most Solaris and illumos systems, the MIN control
character slot overlaps with EOF, and thus has a default value of 4.
This breaks at least the examples in the "termion" crate, and probably
quite a lot of other software written first and foremost for Linux
systems.  We need to force the MIN value to 1 while switching to raw
mode.
2020-04-04 16:53:26 +00:00
Patrick Mooney 3d65979233 Split up Solaris and illumos targets 2020-04-03 03:33:18 +00:00
Yuki Okushi 08e8a3ae8f
Merge pull request #1712 from pfmooney/cfg_attr-cleanup
Clean up unnecessary link_name attributes
2020-04-01 14:02:46 +09:00
Patrick Mooney 1a15af9af5 Clean up unnecessary cfg_attr attributes 2020-03-29 14:29:18 -05:00
Niels Sascha Reedijk ccda4ada09 Haiku: add futimens and utimensat, remove futimes and cleanup.
* Function futimes is not available in Haiku.
 * Functions futimens and utimensat are.
 * Cleanup some leftover cfg_attr attributes.
2020-03-28 08:35:29 +00:00
Yuki Okushi bcbfeb5516
Merge pull request #1708 from pickfire/lockf
Add Lockf POSIX to UNIX targets
2020-03-27 23:00:46 +09:00
Yuki Okushi 8fdf28e3cd
Merge pull request #1705 from tormol/accept4all
Add accept4() for NetBSD, Illumos and Solaris
2020-03-27 21:12:47 +09:00
Ivan Tham dd81021828 Add lockf
Fix #1631
2020-03-26 18:03:55 +08:00
Sergio Lopez 82f070702c Add copy_file_range to linux_like/linux/gnu
This is a Linux-only feature that was already present as a
syscall. Add it just to linux/gnu for the moment, as the musl version
bundled in the Rust's x86_64-unknown-linux-musl toolchain doesn't
include it yet.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2020-03-25 13:16:36 +01:00
Torbjørn Birch Moltu e3bbec2745 Add accept4() for NetBSD, Illumos and Solaris
References:
* NetBSD (became available with 8.0):
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/socket.h?annotate=1.129&only_with_tag=MAIN
  http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/sys/accept4.c?annotate=1.2&only_with_tag=MAIN
* Illumos:
  https://illumos.org/man/3socket/accept
  https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/socket.h
  https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libsocket/socket/weaks.c
* Solaris:
  https://docs.oracle.com/cd/E88353_01/html/E37843/accept-3c.html
2020-03-21 13:16:31 +01:00
Alex Crichton 472e72a268 Add definition of ucontext_t for macOS 2020-03-20 07:31:57 -07:00
Yuki Okushi b7cb4d2c7b
Add constants from `linux/in.h` 2020-03-17 09:48:45 +09:00
Yuki Okushi 598939dd5e
Merge pull request #1653 from ArniDagur/shadow_reenterant
Add reenterant shadow.h functions
2020-03-17 01:46:31 +09:00
Árni Dagur 6ffc752f7c Add renterant shadow functions 2020-03-15 19:08:24 -04:00
Yuki Okushi 64b919f1d4
Merge pull request #1694 from JohnTitor/map-sync
Tweak `MAP_SYNC`
2020-03-15 06:01:59 +09:00
Thomas Hurst 5d8dccc7b7 Add missing AT_ constants
Add AT_EACCESS to Linux, Solaris, and Fuchsia.

Add AT_SYMLINK_FOLLOW, AT_REMOVEDIR, and  _AT_TRIGGER to Solaris.
2020-03-14 17:13:04 +00:00
Yuki Okushi 5e10268b64
Tweak `MAP_SYNC` 2020-03-15 01:17:53 +09:00
Yuki Okushi 69f9844b89
Merge pull request #1658 from connorkuehl/unify-mmap-flags
Unify mmap flags
2020-03-14 04:58:26 +09:00
Yuki Okushi da8f35abe1
Merge pull request #1690 from pwang7/patch-1
add macOS mount flags
2020-03-14 00:50:00 +09:00
Connor Kuehl ae46b45643 Move mmap flag 'MAP_FIXED_NOREPLACE' from gnu/mod.rs to linux/mod.rs 2020-03-13 14:10:16 +00:00
Connor Kuehl bc68163a7b Add mmap flag 'MAP_SYNC' to linux/mod.rs 2020-03-13 14:10:16 +00:00
Connor Kuehl 56bd41794b Move mmap flag 'MAP_SHARED_VALIDATE' to linux/mod.rs from gnu/mod.rs 2020-03-13 14:10:16 +00:00
Pu Wang 4e3a895d9c add macOS mount flags according to
https://github.com/apple/darwin-xnu/blob/master/bsd/sys/mount.h#L288
2020-03-13 17:43:21 +08:00
Andre Nathan c18ab84108 Add F_OFD_* constants 2020-03-10 13:27:38 -03:00
Yuki Okushi 248c826eea
Merge pull request #1678 from jbaublitz/keyctl-consts
Add constants from linux/keyctl.h
2020-03-10 02:54:16 +09:00
Yuki Okushi d0b44a9946
Merge pull request #1661 from Richard-W/linux_reboot_h_constants
Move linux/reboot.h constants into linux module
2020-03-10 02:17:22 +09:00
John Baublitz 47c0d4ae81 Add constants from linux/keyctl.h 2020-03-09 11:00:46 -04:00
Richard Wiedenhöft 42cb2b6455 Move linux/reboot.h constants into linux module 2020-03-09 13:49:01 +01:00
Vita Batrla 3a90b74fc8 Solarish: missing declaration of port_send and port_sendn 2020-03-09 10:15:40 +01:00
Yuki Okushi 7455403a23
Merge pull request #1682 from JohnTitor/reduce-fixme
Add `CLOCK_TAI` to linux_like/mod.rs
2020-03-09 02:34:45 +09:00
Yuki Okushi 920878be36
Merge pull request #1654 from jedisct1/macos_sigstk_constants
Add MINSIGSTKSZ and SIGSTKSZ definitions for MacOS
2020-03-09 01:44:24 +09:00
Yuki Okushi 0e8258bd86
Merge pull request #1651 from zonyitoo/feature-linux-like-ip6t-so-original-dst
Add IP6T_SO_* options definition
2020-03-09 01:19:10 +09:00
Yuki Okushi 8ba9ba2bc6
Merge pull request #1656 from darcyliu/bsd-wait4
Add wait4 for macOS and FreeBSD
2020-03-09 00:26:23 +09:00
Frank Denis 51bbf3667a Add MINSIGSTKSZ and SIGSTKSZ definitions for MacOS 2020-03-08 15:26:37 +01:00
Mikail Bagishov 013fffde23
Add definitions for cgroupfs and cgroup2fs MAGIC 2020-03-08 15:36:29 +03:00
Yuki Okushi 9b31f772bb
Add `CLOCK_TAI` to linux_like/mod.rs 2020-03-08 20:21:01 +09:00
zonyitoo 47e2f8b922 Add IP6T_SO_ORIGINAL_DST definition 2020-03-08 18:31:25 +08:00
Darcy Liu 6885600a97 Add wait4 for macOS and FreeBSD 2020-03-08 18:29:55 +08:00
Yuki Okushi d692ac288e
Merge pull request #1680 from Ralith/pmtu
Add some linux socket MTU constants
2020-03-07 10:30:09 +09:00
Benjamin Saunders ad6279db35 Add some linux socket MTU constants 2020-03-06 14:37:38 -08:00
Daniel Fox Franke 51f1aa42c0 Add <sys/timex.h> declarations for Solaris/IllumOS 2020-03-01 14:23:07 -05:00
Daniel Fox Franke 0a2566d0be Add <sys/timex.h> declarations for BSDs 2020-03-01 14:01:14 -05:00
Daniel Fox Franke b2740e263d Add <sys/timex.h> declarations for Linux 2020-03-01 13:35:39 -05:00
Michal 'vorner' Vaner 35db4e45c7
Nfnetfilter queue constants
Constants for the linux nfqueue netlink protocol (userspace firewall).

Continuation of #1562 and #1571.
2020-03-01 12:43:33 +01:00
Yuki Okushi 7db4619db7
Merge pull request #1640 from andreas-schwab/master
Misc fixes for riscv64-linux-gnu
2020-03-01 13:17:45 +09:00
Yuki Okushi bb496cfaca
Merge pull request #1672 from JohnTitor/ci-tweaks
CI tweaks
2020-03-01 12:28:23 +09:00
Andreas Schwab 481764d617 Define RTLD_* constants for riscv64-linux-gnu 2020-02-29 10:04:42 +01:00
Andreas Schwab ad528864bc Correct PTHREAD_STACK_MIN for riscv64-linux-gnu 2020-02-29 10:04:42 +01:00
Andreas Schwab f2942c671a Define struct flock64 for riscv64-linux-gnu 2020-02-29 10:04:42 +01:00
Andreas Schwab 01ca4a4a8f Fix alignment of struct pthread_mutexattr_t for riscv64-linux-gnu 2020-02-29 10:04:42 +01:00
Yuki Okushi 483bb8171f Replace TODO with FIXME to make grep easy 2020-02-29 13:36:27 +09:00
zonyitoo 1087a0ea42 Add TCP_FASTOPEN_CONNECT for Linux after 4.11
fix #1633
2020-02-29 12:30:39 +08:00
Yuji Yamamoto b03f713e3c
Add definitions in ucontext.h in Android for x86_64
Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r20/libc/include/sys/ucontext.h
2020-02-28 15:54:08 +09:00
Yuji Yamamoto fa543d17fe
Add definitions in ucontext.h in Android for x86
Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r20/libc/include/sys/ucontext.h
2020-02-28 15:52:15 +09:00
Yuji Yamamoto 10fcecfe5a
Add definitions in ucontext.h in Android for ARM
Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r20/libc/include/sys/ucontext.h
2020-02-28 15:50:56 +09:00
Yuki Okushi 4ddd36371e
Merge pull request #1649 from rfael/master
structs nlmsghdr, nlmsgerr and nlattr added to linux mips musl target
2020-02-28 13:21:52 +09:00
Yuki Okushi 7fbc4e96fc
Merge pull request #1648 from reitermarkus/newlib-clock
Add Newlib clock constants and functions.
2020-02-28 13:13:36 +09:00
Emmanuel Gil Peyrot c4e749f8c9 Comment out HWCAP2_* constants on AArch64
They are missing in the CI’s linux-api-headers, and not widely available
yet either.
2020-02-27 19:21:45 +01:00
Emmanuel Gil Peyrot 09ec6a6796 Add missing AArch64 HWCAP_* and HWCAP2_* values. 2020-02-26 11:08:09 +01:00
Emmanuel Gil Peyrot 912fc7beec Add missing AT_* constants from sys/auxv.h 2020-02-26 11:08:09 +01:00
Emmanuel Gil Peyrot 19ced2f596 Move getauxval() to libc, not to libutil. 2020-02-26 11:08:09 +01:00
Yuki Okushi b030ee4f47
Merge pull request #1635 from zonyitoo/feature-macos-fastopen
Add TCP FastOpen support for macOS
2020-02-23 16:13:12 +09:00
Lzu Tao 723a2c7d87 add wmemchr to all platforms support memchr 2020-02-21 10:42:15 +07:00
zonyitoo 53a2e7ed57 Add TCP FastOpen support for macOS
fix #1632
2020-02-21 08:58:53 +08:00
Yuki Okushi 89a8e048be
Merge pull request #1639 from vickenty/memmem
Add memmem
2020-02-21 08:15:44 +09:00
Markus Reiter b1d6c663d3 Add Newlib clock constants and functions. 2020-02-20 01:15:28 +01:00
ru 5472ccded8 structs nlmsghdr, nlmsgerr and nlattr added to linux arm and x86 musl targets 2020-02-19 14:31:31 +01:00
ru 1d43891df2 structs nlmsghdr, nlmsgerr and nlattr added to linux mips64 musl target 2020-02-19 14:31:31 +01:00
ru 6a04eb97eb structs nlmsghdr, nlmsgerr and nlattr added to linux mips musl target 2020-02-19 14:31:31 +01:00
Marco A L Barbosa 1914ae894e Add qsort, qsort_r and bsearch 2020-02-19 07:55:31 -03:00
Vickenty Fesunov 1c012aec18 Add memmem
memmem is a non-standard extension, first added in GNU libc and later
ported to other systems. Support for it is non-uniform, thus it was only
added to platforms that seem to support it.
2020-02-19 10:32:33 +01:00
Vickenty Fesunov 9358be36d6 Remove unnecessary parenthesis
This triggers a warning on a recent nightly, which in turn breaks CI due to
`#![deny(warnings)]` in libc-test/build.rs
2020-02-12 10:09:22 +01:00
bors 74ff412239 Auto merge of #1621 - coolreader18:fdset-redox-ai-android, r=gnzlbg
Add Redox FD_* function-macros and Android AI_* constants

I'm not sure if I'm allowed to add multiple, separate APIs in the same PR, but I guess they're both for uncommon/exotic platforms?

The `AI_*` constants were taken from `usr/include/netdb.h` on my Termux install; the `FD_` functions were taken from `linux_like/mod.rs`.
2019-12-27 10:25:02 +00:00
bors 80c6c64843 Auto merge of #1624 - noam93k:master, r=gnzlbg
Add dlmopen dlinfo and related consts.

I actually have no idea if the constants I copied from my computer are cross-platform.
2019-12-23 15:25:00 +00:00
bors 4c41ef07fc Auto merge of #1612 - GrayJack:fix_utmpx_debug_solarish, r=gnzlbg
Solarish: Fix utmx Debug impl and re-add support for extra traits

Fix a bug where the compilation failed cause `utmpx.host` is bigger than 32 so we cannot print it.

Due to a break of compilation (only with extra trait enabled) on a Tier 2 platform, I do think it would be better to do another release as soon as proven fixing compilation
2019-12-23 14:26:32 +00:00
Noam Shalom Kleinburd 41b09a1c47 Fix linting errors. 2019-12-18 21:07:00 +02:00
Noam Kleinburd a9cb77f2d5 Add dlmopen dlinfo and related consts. 2019-12-18 20:49:53 +02:00
GrayJack b135afcc22 Allow missing debug instead of impl Debug for union in this case 2019-12-11 09:35:03 -03:00
coolreader18 aa6f5e2b38
Add FD_* functions/macros for redox; implementations copied from linux_like 2019-12-08 22:10:06 -06:00
GrayJack 128c36d67a Formatting 2019-12-08 06:09:50 -03:00
GrayJack d6517796ec Fix missing finish() in Debug impl of door_desc_t__d_data 2019-12-08 06:03:11 -03:00
GrayJack 9298405584 Implement debug for door_desc_t__d_data 2019-12-08 04:01:47 -03:00
GrayJack e551eca809 Fix debug of utmp.host like reviewer suggestion 2019-12-08 03:38:47 -03:00
coolreader18 6eca76726b
Add AI_* constants on android; taken from netdb.h 2019-12-07 23:48:38 -06:00
Matthew McPherrin 73c243700c Add sock_extended_err and associated constants from errqueue.h
sock_extended_err is a struct returned as a control message when the sockopt
IP_RECVERR is set, when recvmsg has the MSG_ERRQUEUE flag set.  IP_RECVERR and
MSG_ERRQUEUE are constants both already defined here.
2019-12-02 01:06:43 -08:00
GrayJack 6a11b2b473 Fix debug as we cannot print host as of today 2019-11-30 06:07:27 -03:00
bors bba019bff5 Auto merge of #1610 - GrayJack:utmp_netbsd, r=gnzlbg
Implement utmp for NetBSD

Followed this: https://github.com/NetBSD/src/blob/trunk/include/utmp.h
2019-11-29 11:00:07 +00:00
bors ea0a54a661 Auto merge of #1608 - lzutao:netbsd-mut-pthread_setname_np, r=gnzlbg
use *const pointer for NetBSD's pthread_setname_np
2019-11-29 09:54:20 +00:00
GrayJack 42289eb64f Implement utmp for NetBSD 2019-11-28 20:47:50 -03:00
bors cfd561c289 Auto merge of #1605 - zvirja:fix-mipsel-unknown-linux-uclibc, r=gnzlbg
Add ucred and socket related types to uclibc-mips32

Fix compilation of the [tokio](https://github.com/tokio-rs) rust for MIPS architecture when using uClibc. Added missed types, which are defined in library headers:
ca1c74d67d/libc/sysdeps/linux/common/bits/socket.h (L320)
ca1c74d67d/libc/sysdeps/linux/common/bits/in.h (L35-L36)
ca1c74d67d/libc/sysdeps/linux/common/bits/in.h (L140-L143)

Should also solve https://github.com/rust-lang-nursery/net2-rs/issues/88

Revisit of #1500
2019-11-28 14:38:37 +00:00