Skip to content

Commit da2c8e8

Browse files
committed
Merge branch 'master' into groups-funcs
2 parents d2c47ff + 28c5b4a commit da2c8e8

36 files changed

+1319
-1089
lines changed

.travis.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ env:
1212

1313
matrix:
1414
# These are all the build jobs. Adjust as necessary. Comment out what you
15-
# don't need
15+
# don't need. The iOS/Mac builds are distributed throughout because Travis
16+
# likes to have a big backlog on builds on those machines. This way at least
17+
# all of the other jobs can finish while waiting on those builds.
1618
include:
1719
# Android
1820
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
@@ -21,70 +23,63 @@ matrix:
2123
rust: 1.13.0
2224
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
2325
rust: 1.13.0
26+
- env: TARGET=aarch64-apple-ios DISABLE_TESTS=1
27+
rust: 1.13.0
28+
os: osx
2429
- env: TARGET=i686-linux-android DISABLE_TESTS=1
2530
rust: 1.18.0
2631
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
2732
rust: 1.18.0
2833

29-
# iOS
30-
- env: TARGET=aarch64-apple-ios DISABLE_TESTS=1
34+
# Linux
35+
- env: TARGET=aarch64-unknown-linux-gnu
3136
rust: 1.13.0
32-
os: osx
3337
- env: TARGET=armv7-apple-ios DISABLE_TESTS=1
3438
rust: 1.13.0
3539
os: osx
36-
- env: TARGET=armv7s-apple-ios DISABLE_TESTS=1
37-
rust: 1.13.0
38-
os: osx
39-
- env: TARGET=i386-apple-ios DISABLE_TESTS=1
40-
rust: 1.13.0
41-
os: osx
42-
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
43-
rust: 1.13.0
44-
os: osx
45-
46-
# Linux
47-
- env: TARGET=aarch64-unknown-linux-gnu
48-
rust: 1.13.0
4940
- env: TARGET=arm-unknown-linux-gnueabi
5041
rust: 1.13.0
5142
- env: TARGET=arm-unknown-linux-musleabi DISABLE_TESTS=1
5243
rust: 1.14.0
5344
- env: TARGET=armv7-unknown-linux-gnueabihf
5445
rust: 1.13.0
46+
- env: TARGET=armv7s-apple-ios DISABLE_TESTS=1
47+
rust: 1.13.0
48+
os: osx
5549
- env: TARGET=i686-unknown-linux-gnu
5650
rust: 1.13.0
5751
- env: TARGET=i686-unknown-linux-musl
5852
rust: 1.13.0
5953
- env: TARGET=mips-unknown-linux-gnu
6054
rust: 1.13.0
55+
- env: TARGET=i386-apple-ios DISABLE_TESTS=1
56+
rust: 1.13.0
57+
os: osx
6158
- env: TARGET=mips64-unknown-linux-gnuabi64
6259
rust: 1.13.0
6360
- env: TARGET=mips64el-unknown-linux-gnuabi64
6461
rust: 1.13.0
6562
- env: TARGET=mipsel-unknown-linux-gnu
6663
rust: 1.13.0
64+
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
65+
rust: 1.13.0
66+
os: osx
6767
- env: TARGET=powerpc-unknown-linux-gnu DISABLE_TESTS=1
6868
rust: 1.13.0
6969
- env: TARGET=powerpc64-unknown-linux-gnu
7070
rust: 1.13.0
7171
- env: TARGET=powerpc64le-unknown-linux-gnu
7272
rust: 1.13.0
73+
- env: TARGET=i686-apple-darwin
74+
rust: 1.13.0
75+
os: osx
7376
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
7477
rust: 1.13.0
7578
- env: TARGET=x86_64-unknown-linux-gnu
7679
rust: 1.13.0
7780
- env: TARGET=x86_64-unknown-linux-musl
7881
rust: 1.13.0
7982

80-
# OSX
81-
- env: TARGET=i686-apple-darwin
82-
rust: 1.13.0
83-
os: osx
84-
- env: TARGET=x86_64-apple-darwin
85-
rust: 1.13.0
86-
os: osx
87-
8883
# *BSD
8984
# FreeBSD i686 and x86_64 use BuildBot instead of Travis
9085
# Note that i686-unknown-freebsd is actually using stable Rust instead of
@@ -94,6 +89,10 @@ matrix:
9489
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
9590
rust: 1.13.0
9691

92+
- env: TARGET=x86_64-apple-darwin
93+
rust: 1.13.0
94+
os: osx
95+
9796
# Testing beta on main targets
9897
- env: TARGET=x86_64-unknown-linux-gnu
9998
rust: beta

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
66
## [Unreleased]
77

88
### Added
9+
- Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines
10+
with `sys::ptrace::ptrace` is now deprecated.
911
- Added `nix::poll` module for all platforms
1012
([#672](https://github.com/nix-rust/nix/pull/672))
1113
- Added `nix::ppoll` function for FreeBSD and DragonFly
@@ -14,19 +16,37 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1416
([#647](https://github.com/nix-rust/nix/pull/647))
1517
- Added the `pid()` method to `WaitStatus` for extracting the PID.
1618
([#722](https://github.com/nix-rust/nix/pull/722))
19+
- Added `nix::unistd:fexecve`.
20+
([#727](https://github.com/nix-rust/nix/pull/727))
21+
- Expose `uname()` on all platforms.
22+
([#739](https://github.com/nix-rust/nix/pull/739))
23+
- Expose `signalfd` module on Android as well.
24+
([#739](https://github.com/nix-rust/nix/pull/739))
1725

1826
### Changed
1927
- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692))
28+
- Marked `sys::ptrace::ptrace` as `unsafe`.
2029
- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument
2130
has changed type from `c_int` to `SockProtocol`.
2231
It accepts a `None` value for default protocol that was specified with zero using `c_int`.
2332
([#647](https://github.com/nix-rust/nix/pull/647))
33+
- Made `select` easier to use, adding the ability to automatically calculate the `nfds` parameter using the new
34+
`FdSet::highest` ([#701](https://github.com/nix-rust/nix/pull/701))
2435
- Exposed `unistd::setresuid` and `unistd::setresgid` on FreeBSD and OpenBSD
2536
([#721](https://github.com/nix-rust/nix/pull/721))
2637
- Refactored the `statvfs` module removing extraneous API functions and the
2738
`statvfs::vfs` module. Additionally `(f)statvfs()` now return the struct
2839
directly. And the returned `Statvfs` struct now exposes its data through
2940
accessor methods. ([#729](https://github.com/nix-rust/nix/pull/729))
41+
- The `addr` argument to `madvise` and `msync` is now `*mut` to better match the
42+
libc API. ([#731](https://github.com/nix-rust/nix/pull/731))
43+
- `shm_open` and `shm_unlink` are no longer exposed on Android targets, where
44+
they are not officially supported. ([#731](https://github.com/nix-rust/nix/pull/731))
45+
- `MapFlags`, `MmapAdvise`, and `MsFlags` expose some more variants and only
46+
officially-supported variants are provided for each target.
47+
([#731](https://github.com/nix-rust/nix/pull/731))
48+
- Marked `pty::ptsname` function as `unsafe`
49+
([#744](https://github.com/nix-rust/nix/pull/744))
3050

3151
# Fixed
3252
- Fix compilation and tests for OpenBSD targets

CONVENTIONS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ For example,
5252

5353
```rust
5454
libc_bitflags!{
55-
pub flags ProtFlags: libc::c_int {
56-
PROT_NONE,
57-
PROT_READ,
58-
PROT_WRITE,
59-
PROT_EXEC,
55+
pub struct ProtFlags: libc::c_int {
56+
PROT_NONE;
57+
PROT_READ;
58+
PROT_WRITE;
59+
PROT_EXEC;
6060
#[cfg(any(target_os = "linux", target_os = "android"))]
61-
PROT_GROWSDOWN,
61+
PROT_GROWSDOWN;
6262
#[cfg(any(target_os = "linux", target_os = "android"))]
63-
PROT_GROWSUP,
63+
PROT_GROWSUP;
6464
}
6565
}
6666
```

src/fcntl.rs

Lines changed: 42 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@ mod ffi {
2020
pub const F_GET_SEALS: c_int = 1034;
2121
}
2222

23-
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
2423
libc_bitflags!{
25-
pub flags AtFlags: c_int {
26-
AT_SYMLINK_NOFOLLOW,
24+
pub struct AtFlags: c_int {
25+
AT_SYMLINK_NOFOLLOW;
2726
#[cfg(any(target_os = "linux", target_os = "android"))]
28-
AT_NO_AUTOMOUNT,
27+
AT_NO_AUTOMOUNT;
2928
#[cfg(any(target_os = "linux", target_os = "android"))]
30-
AT_EMPTY_PATH
29+
AT_EMPTY_PATH;
3130
}
3231
}
3332

34-
#[cfg(any(target_os = "ios", target_os = "macos"))]
35-
bitflags!(
36-
pub struct AtFlags: c_int {
37-
// hack because bitflags require one entry
38-
const EMPTY = 0x0;
39-
}
40-
);
41-
4233
pub fn open<P: ?Sized + NixPath>(path: &P, oflag: OFlag, mode: Mode) -> Result<RawFd> {
4334
let fd = try!(path.with_nix_path(|cstr| {
4435
unsafe { libc::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) }
@@ -54,7 +45,7 @@ pub fn openat<P: ?Sized + NixPath>(dirfd: RawFd, path: &P, oflag: OFlag, mode: M
5445
Errno::result(fd)
5546
}
5647

57-
fn wrap_readlink_result<'a>(buffer: &'a mut[u8], res: ssize_t)
48+
fn wrap_readlink_result<'a>(buffer: &'a mut[u8], res: ssize_t)
5849
-> Result<&'a OsStr> {
5950
match Errno::result(res) {
6051
Err(err) => Err(err),
@@ -204,11 +195,11 @@ mod consts {
204195
use libc::{self, c_int, c_uint};
205196

206197
libc_bitflags! {
207-
pub flags SpliceFFlags: c_uint {
208-
SPLICE_F_MOVE,
209-
SPLICE_F_NONBLOCK,
210-
SPLICE_F_MORE,
211-
SPLICE_F_GIFT,
198+
pub struct SpliceFFlags: c_uint {
199+
SPLICE_F_MOVE;
200+
SPLICE_F_NONBLOCK;
201+
SPLICE_F_MORE;
202+
SPLICE_F_GIFT;
212203
}
213204
}
214205

@@ -239,8 +230,8 @@ mod consts {
239230
);
240231

241232
libc_bitflags!(
242-
pub flags FdFlag: c_int {
243-
FD_CLOEXEC
233+
pub struct FdFlag: c_int {
234+
FD_CLOEXEC;
244235
}
245236
);
246237

@@ -261,49 +252,49 @@ mod consts {
261252
use libc::{self,c_int};
262253

263254
libc_bitflags!(
264-
pub flags OFlag: c_int {
265-
O_ACCMODE,
266-
O_RDONLY,
267-
O_WRONLY,
268-
O_RDWR,
269-
O_NONBLOCK,
270-
O_APPEND,
271-
O_SHLOCK,
272-
O_EXLOCK,
273-
O_ASYNC,
274-
O_SYNC,
275-
O_NOFOLLOW,
276-
O_CREAT,
277-
O_TRUNC,
278-
O_EXCL,
279-
O_NOCTTY,
280-
O_DIRECTORY,
281-
O_CLOEXEC,
282-
O_FSYNC,
283-
O_NDELAY,
255+
pub struct OFlag: c_int {
256+
O_ACCMODE;
257+
O_RDONLY;
258+
O_WRONLY;
259+
O_RDWR;
260+
O_NONBLOCK;
261+
O_APPEND;
262+
O_SHLOCK;
263+
O_EXLOCK;
264+
O_ASYNC;
265+
O_SYNC;
266+
O_NOFOLLOW;
267+
O_CREAT;
268+
O_TRUNC;
269+
O_EXCL;
270+
O_NOCTTY;
271+
O_DIRECTORY;
272+
O_CLOEXEC;
273+
O_FSYNC;
274+
O_NDELAY;
284275
#[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "macos",
285276
target_os = "ios"))]
286-
O_DSYNC,
277+
O_DSYNC;
287278
#[cfg(any(target_os = "netbsd", target_os = "dragonfly", target_os = "freebsd"))]
288-
O_DIRECT,
279+
O_DIRECT;
289280
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
290-
O_RSYNC,
281+
O_RSYNC;
291282
#[cfg(target_os = "freebsd")]
292-
O_EXEC,
283+
O_EXEC;
293284
#[cfg(target_os = "freebsd")]
294-
O_TTY_INIT,
285+
O_TTY_INIT;
295286
#[cfg(target_os = "netbsd")]
296-
O_ALT_IO,
287+
O_ALT_IO;
297288
#[cfg(target_os = "netbsd")]
298-
O_NOSIGPIPE,
289+
O_NOSIGPIPE;
299290
#[cfg(target_os = "netbsd")]
300-
O_SEARCH,
291+
O_SEARCH;
301292
}
302293
);
303294

304295
libc_bitflags!(
305-
pub flags FdFlag: c_int {
306-
FD_CLOEXEC
296+
pub struct FdFlag: c_int {
297+
FD_CLOEXEC;
307298
}
308299
);
309300
}

0 commit comments

Comments
 (0)