Commit Graph

420 Commits

Author SHA1 Message Date
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
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
Simon Wörner 4a9413ba54 added freebsd register structs 2020-06-22 17:33:09 +02:00
Patrick Mooney b53ccb8740 illumos: Add eventfd support 2020-06-09 20:57:33 +00:00
Yuki Okushi c6fb0f37ad
Run rustfmt 2020-06-02 20:37:34 +09:00
Yuki Okushi a6920f9a5a
Use ctest2 to drop old dependencies 2020-06-02 01:10:08 +09:00
Yuki Okushi 8d3cc4b527
Update FIXME comment 2020-05-23 12:32:55 +09:00
Yuki Okushi f8f9a8e6f6
Merge pull request #1768 from Erk-/freebsd-getnameinfo-flags
[FreeBSD] Add missing getnameinfo() flag values.
2020-05-22 00:16:19 +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 1528539b0a
Ignore fns that have suddenly disappeared on Android CI 2020-05-21 15:29:10 +09:00
Yuki Okushi b12c35f0cd
Skip test for `mode` field of `ipc_perm` 2020-04-30 14:27:59 +09:00
Yuki Okushi b05f659361
Skip some items changed in glibc 2.31 2020-04-21 12:18:40 +09:00
Yuki Okushi e69c5eaa9f
Merge pull request #1734 from JohnTitor/docs
Minor clean-up CI docs
2020-04-14 09:04:42 +09:00
Yuki Okushi 1ef129b210
Minor clean-up CI docs 2020-04-14 03:23:50 +09:00
Yuki Okushi 622e6f5d25
Update node to v12.16.2 2020-04-14 02:48:35 +09:00
Yuki Okushi 991678ce0b
Skip test for `SYS_gettid` 2020-04-14 02:48:35 +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
Yuki Okushi 27f89544a8
Run rustfmt 2020-04-11 22:13:58 +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
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
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
Patrick Mooney 48594dc7c1 Update ctest for illumos and Solaris 2020-04-03 13:16:58 +00:00
Yuki Okushi 52270b06e2
Enable `s390x-unknown-linux-gnu` on CI 2020-03-15 15:10:50 +09:00
John Baublitz 47c0d4ae81 Add constants from linux/keyctl.h 2020-03-09 11:00:46 -04:00
zonyitoo 47e2f8b922 Add IP6T_SO_ORIGINAL_DST definition 2020-03-08 18:31:25 +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 b2740e263d Add <sys/timex.h> declarations for Linux 2020-03-01 13:35:39 -05:00
Daniel Fox Franke 2fe7865372 Include <sys/timex.h> in libc-test 2020-03-01 11:45:33 -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 9f9a5edcee Skip some items changed in Catalina 2020-03-01 00:19:09 +09:00
Yuji Yamamoto 338dd7c085
Add ucontext.h to test target 2020-02-28 15:59:48 +09:00
Yuki Okushi 72448d2885 Skip statx and statx_timestamp for now 2020-02-25 16:44:21 +09:00
Yuki Okushi 804a11dc89 Ignore `sys/io.h` on gnuabihf 2020-02-25 16:44:21 +09:00
Yuki Okushi f77dcc4811 Ignore deprecated header file in gnu 2020-02-25 14:46:21 +09:00
BaoshanPang e2eb0a6e5e add functions for message queue 2020-02-24 10:02:02 -08: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 a3c5f9b72c Auto merge of #1616 - mcpherrinm:withandroid, r=gnzlbg
Add sock_extended_err and associated constants from errqueue.h to linux_like

This is an alternate version of #1614 that attempts to fix issues with the android ctests by rearranging the headers.  Due to long CI cycle time, I've opened it as an alternate PR.  Only one or the other should merge, depending if linux_like or linux is the correct place for this.

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-23 11:58:51 +00:00
Alex Crichton 93743ca839 Update bindings for the wasm32-wasi target
This commit performs a number of updates for libc with the `wasm32-wasi`
target:

* Updates the `wasi-libc` repository commit used (previously known as
  `wasi-sysroot`)
* Updates the container to Ubuntu 19.10 which has Clang 9 packaged which
  is all we need.
* Avoids building `wasmtime` and instead downloads a precompiled binary.
* Updates bindings in `src/wasi.rs` to match the current upstream state.
2019-12-16 07:57:52 -08:00
Matthew McPherrin 06938add2d Add test for SO_EE_OFFENDER
Modelled after the cmsg tests, this wraps the C macro into a function, and then
compares the results to the Rust implementation in libc.
2019-12-02 17:02:23 -08:00
Matthew McPherrin a9a6ef13a1 rustfmt build.rs 2019-12-02 10:35:40 -08:00
Matthew McPherrin d1a404c5ad Missing errqueue.h in android 2019-12-02 01:25:50 -08: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
Matthew McPherrin 104a3f2aba Move linux/ headers down in test_android
This moves the linux/ headers after others
This keeps the Android tests closer to the Linux ones.
I think this is needed to get linux/errqueue.h to not cause compilation
failures.
2019-12-02 01:01:52 -08:00
bors 122ca908ee Auto merge of #1578 - fatpelt:master, r=gnzlbg
- add ssm struct and setsockopt constants

Signed-off-by: patrick felt <patrick.felt@sling.com>
2019-11-25 12:13:04 +00:00
bors 7f33bcb399 Auto merge of #1561 - elichai:2019-10-flock64, r=gnzlbg
Add flock64 to linux_like platforms

Hi,
I'm not sure about what to make of the ifdef in glibc `__USE_LARGEFILE64` that covers it.
but I copied the impl from glibc's headers.
everything is the same except for sparc which has a reserved short int.
and in musl it's just `#define flock64 flock`
2019-11-25 09:55:59 +00:00
Elichai Turkel 490e073525
Fix wording in the build script flock64 rule
Co-Authored-By: gnzlbg <gnzlbg@users.noreply.github.com>
2019-11-25 11:33:21 +02:00
patrick felt 2cb9eec131 - skip the roundtrip c check due to alignment
Signed-off-by: patrick felt <patrick.felt@sling.com>
2019-11-21 17:02:26 -07:00
Elichai Turkel 66529ed375
Add a rule for flock64 in libc-test build script 2019-11-21 23:41:54 +02:00
bors 2d94f3f373 Auto merge of #1588 - oxalica:upgrade-musl, r=gnzlbg
Upgrade to musl 1.1.24 in CI

Required by #1577

Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](13d4a5da2e/src/unix/linux_like/mod.rs (L97)) are outdated. I'm not sure if we should rename them, since they are in public API.

I simply skip `struct sched_param` from the test now.

Here's the diff between musl 1.1.23 and 1.1.24
```
diff --git a/include/sched.h b/include/sched.h
index 05d40b1e..7e470d3a 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -18,10 +18,12 @@ extern "C" {

 struct sched_param {
        int sched_priority;
-       int sched_ss_low_priority;
-       struct timespec sched_ss_repl_period;
-       struct timespec sched_ss_init_budget;
-       int sched_ss_max_repl;
+       int __reserved1;
+       struct {
+               time_t __reserved1;
+               long __reserved2;
+       } __reserved2[2];
+       int __reserved3;
 };
```
2019-11-21 20:34:40 +00:00