diff options
author | bors <bors@rust-lang.org> | 2018-05-17 17:31:29 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2018-05-17 17:31:29 +0000 |
commit | 5e025d65d40bde298dc36c289f11c5717fab6fa3 (patch) | |
tree | 738c58d5f48587fe16ea88a0d4d281517b8513e4 | |
parent | d0a57265999c78aa56c0202d97911e16e43baea3 (diff) | |
parent | 96ee7bf81cfdc3118e8ed4921ce64630a4dbfc0d (diff) | |
download | rust-libc-5e025d65d40bde298dc36c289f11c5717fab6fa3.tar.gz |
Auto merge of #988 - morrowa:new_freebsd_sf_flags, r=alexcrichton
Add new sendfile flags for FreeBSD
Two new constants for FreeBSD:
* `SF_USER_READAHEAD` introduced in FreeBSD 12 [in this commit](https://github.com/freebsd/freebsd/commit/b739d603442d3aa17f07d55918ca3a07eefa24f7#diff-b3f45d20f63d013e46f59f3f88a84d3d) (omitted from tests until FreeBSD 12 is stable)
* `SF_NOCACHE` introduced in FreeBSD 11 [in this commit](https://github.com/freebsd/freebsd/commit/aaa09777e1d9fde5591814af536025be01a0182f#diff-b3f45d20f63d013e46f59f3f88a84d3d)
-rw-r--r-- | libc-test/build.rs | 3 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 1262eea1bd..82491bbfdc 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -521,6 +521,9 @@ fn main() { "EVFILT_PROCDESC" | "EVFILT_SENDFILE" | "EVFILT_EMPTY" | "PD_CLOEXEC" | "PD_ALLOWED_AT_FORK" if freebsd => true, + // These constants were added in FreeBSD 12 + "SF_USER_READAHEAD" if freebsd => true, + // These OSX constants are removed in Sierra. // https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html "KERN_KDENABLE_BG_TRACE" if apple => true, diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index a2a6d69375..def81dfe2e 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -168,6 +168,8 @@ pub const SIGSTKSZ: ::size_t = 34816; pub const SF_NODISKIO: ::c_int = 0x00000001; pub const SF_MNOWAIT: ::c_int = 0x00000002; pub const SF_SYNC: ::c_int = 0x00000004; +pub const SF_USER_READAHEAD: ::c_int = 0x00000008; +pub const SF_NOCACHE: ::c_int = 0x00000010; pub const O_CLOEXEC: ::c_int = 0x00100000; pub const O_DIRECTORY: ::c_int = 0x00020000; pub const O_EXEC: ::c_int = 0x00040000; |