Skip to content

Commit 6d6ae0b

Browse files
author
Markus Wanner (mwa)
committed
Merge branch 'master' into support-getifaddrs
2 parents 144e4e1 + 9f4db8a commit 6d6ae0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3863
-2768
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/CHANGELOG.md merge=union

.travis.yml

Lines changed: 35 additions & 39 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,91 +23,85 @@ 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
51-
- env: TARGET=arm-unknown-linux-musleabi
42+
- 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
67-
- env: TARGET=powerpc-unknown-linux-gnu
64+
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
65+
rust: 1.13.0
66+
os: osx
67+
- 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=s390x-unknown-linux-gnu
73+
- env: TARGET=i686-apple-darwin
74+
rust: 1.13.0
75+
os: osx
76+
- 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
83+
# *BSD
84+
# FreeBSD i686 and x86_64 use BuildBot instead of Travis
85+
# Note that i686-unknown-freebsd is actually using stable Rust instead of
86+
# 1.13.0 because rustup does not support i686-unknown-freebsd
87+
# - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
88+
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
89+
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
8290
rust: 1.13.0
83-
os: osx
91+
8492
- env: TARGET=x86_64-apple-darwin
8593
rust: 1.13.0
8694
os: osx
8795

88-
# *BSD
89-
- env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
90-
rust: 1.13.0
91-
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 # Uses BuildBot instead
92-
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
93-
rust: 1.13.0
94-
9596
# Testing beta on main targets
9697
- env: TARGET=x86_64-unknown-linux-gnu
9798
rust: beta
9899

99100
allow_failures:
100-
# Planning to add these targets, but they can fail for now
101-
- env: TARGET=mips64-unknown-linux-gnuabi64
102-
rust: 1.13.0
103-
- env: TARGET=mips64el-unknown-linux-gnuabi64
104-
rust: 1.13.0
105-
- env: TARGET=arm-unknown-linux-musleabi
106-
rust: 1.14.0
107-
- env: TARGET=s390x-unknown-linux-gnu
108-
rust: 1.13.0
101+
# We allow beta to fail here because a bug might crop up in rust that causes it. We will
102+
# however be on the lookout for this and file those bugs with upstream.
103+
- env: TARGET=x86_64-unknown-linux-gnu
104+
rust: beta
109105

110106
before_install: set -e
111107

CHANGELOG.md

Lines changed: 92 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,74 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [Unreleased]
77

8+
### Added
9+
- Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines
10+
with `sys::ptrace::ptrace` is now deprecated.
11+
- Added `nix::poll` module for all platforms
12+
([#672](https://github.com/nix-rust/nix/pull/672))
13+
- Added `nix::ppoll` function for FreeBSD and DragonFly
14+
([#672](https://github.com/nix-rust/nix/pull/672))
15+
- Added protocol families in `AddressFamily` enum.
16+
([#647](https://github.com/nix-rust/nix/pull/647))
17+
- Added the `pid()` method to `WaitStatus` for extracting the PID.
18+
([#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))
25+
- Added nix::sys::ptrace::detach.
26+
([#749](https://github.com/nix-rust/nix/pull/749))
27+
- Added timestamp socket control message variant:
28+
`nix::sys::socket::ControlMessage::ScmTimestamp`
29+
([#663](https://github.com/nix-rust/nix/pull/663))
30+
- Added socket option variant that enables the timestamp socket
31+
control message: `nix::sys::socket::sockopt::ReceiveTimestamp`
32+
([#663](https://github.com/nix-rust/nix/pull/663))
33+
34+
### Changed
35+
- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692))
36+
- Marked `sys::ptrace::ptrace` as `unsafe`.
37+
- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument
38+
has changed type from `c_int` to `SockProtocol`.
39+
It accepts a `None` value for default protocol that was specified with zero using `c_int`.
40+
([#647](https://github.com/nix-rust/nix/pull/647))
41+
- Made `select` easier to use, adding the ability to automatically calculate the `nfds` parameter using the new
42+
`FdSet::highest` ([#701](https://github.com/nix-rust/nix/pull/701))
43+
- Exposed `unistd::setresuid` and `unistd::setresgid` on FreeBSD and OpenBSD
44+
([#721](https://github.com/nix-rust/nix/pull/721))
45+
- Refactored the `statvfs` module removing extraneous API functions and the
46+
`statvfs::vfs` module. Additionally `(f)statvfs()` now return the struct
47+
directly. And the returned `Statvfs` struct now exposes its data through
48+
accessor methods. ([#729](https://github.com/nix-rust/nix/pull/729))
49+
- The `addr` argument to `madvise` and `msync` is now `*mut` to better match the
50+
libc API. ([#731](https://github.com/nix-rust/nix/pull/731))
51+
- `shm_open` and `shm_unlink` are no longer exposed on Android targets, where
52+
they are not officially supported. ([#731](https://github.com/nix-rust/nix/pull/731))
53+
- `MapFlags`, `MmapAdvise`, and `MsFlags` expose some more variants and only
54+
officially-supported variants are provided for each target.
55+
([#731](https://github.com/nix-rust/nix/pull/731))
56+
- Marked `pty::ptsname` function as `unsafe`
57+
([#744](https://github.com/nix-rust/nix/pull/744))
58+
- Moved constants ptrace request, event and options to enums and updated ptrace functions and argument types accordingly.
59+
([#749](https://github.com/nix-rust/nix/pull/749))
60+
- `AioCb::Drop` will now panic if the `AioCb` is still in-progress ([#715](https://github.com/nix-rust/nix/pull/715))
61+
62+
# Fixed
63+
- Fix compilation and tests for OpenBSD targets
64+
([#688](https://github.com/nix-rust/nix/pull/688))
65+
- Fixed error handling in `AioCb::fsync`, `AioCb::read`, and `AioCb::write`.
66+
It is no longer an error to drop an `AioCb` that failed to enqueue in the OS.
67+
([#715](https://github.com/nix-rust/nix/pull/715))
68+
69+
# Removed
70+
- The syscall module has been removed. This only exposed enough functionality for
71+
`memfd_create()` and `pivot_root()`, which are still exposed as separate functions.
72+
([#747](https://github.com/nix-rust/nix/pull/747))
73+
74+
## [0.9.0] 2017-07-23
75+
876
### Added
977
- Added `sysconf`, `pathconf`, and `fpathconf`
1078
([#630](https://github.com/nix-rust/nix/pull/630)
@@ -24,11 +92,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2492
and nix::Error::UnsupportedOperation}`
2593
([#614](https://github.com/nix-rust/nix/pull/614))
2694
- Added `cfmakeraw`, `cfsetspeed`, and `tcgetsid`. ([#527](https://github.com/nix-rust/nix/pull/527))
95+
- Added "bad none", "bad write_ptr", "bad write_int", and "bad readwrite" variants to the `ioctl!`
96+
macro. ([#670](https://github.com/nix-rust/nix/pull/670))
97+
- On Linux and Android, added support for receiving `PTRACE_O_TRACESYSGOOD`
98+
events from `wait` and `waitpid` using `WaitStatus::PtraceSyscall`
99+
([#566](https://github.com/nix-rust/nix/pull/566)).
27100

28101
### Changed
29-
- Changed `ioctl!(write ...)` to take argument by value instead as pointer.
30-
If you need a pointer as argument, use `ioctl!(write buf ...)`.
31-
([#626](https://github.com/nix-rust/nix/pull/626))
102+
- The `ioctl!` macro and its variants now allow the generated functions to have
103+
doccomments. ([#661](https://github.com/nix-rust/nix/pull/661))
104+
- Changed `ioctl!(write ...)` into `ioctl!(write_ptr ...)` and `ioctl!(write_int ..)` variants
105+
to more clearly separate those use cases. ([#670](https://github.com/nix-rust/nix/pull/670))
32106
- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe.
33107
([#559](https://github.com/nix-rust/nix/pull/559))
34108
- Minimum supported Rust version is now 1.13.
@@ -46,10 +120,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
46120
Also file system type constants like `nix::sys::statfs::ADFS_SUPER_MAGIC` were removed in favor of the libc equivalent.
47121
([#561](https://github.com/nix-rust/nix/pull/561))
48122
- Revised the termios API including additional tests and documentation and exposed it on iOS. ([#527](https://github.com/nix-rust/nix/pull/527))
123+
- `eventfd`, `signalfd`, and `pwritev`/`preadv` functionality is now included by default for all
124+
supported platforms. ([#681](https://github.com/nix-rust/nix/pull/561))
125+
- The `ioctl!` macro's plain variants has been replaced with "bad read" to be consistent with
126+
other variants. The generated functions also have more strict types for their arguments. The
127+
"*_buf" variants also now calculate total array size and take slice references for improved type
128+
safety. The documentation has also been dramatically improved.
129+
([#670](https://github.com/nix-rust/nix/pull/670))
49130

50131
### Removed
51132
- Removed `io::Error` from `nix::Error` and the conversion from `nix::Error` to `Errno`
52133
([#614](https://github.com/nix-rust/nix/pull/614))
134+
- All feature flags have been removed in favor of conditional compilation on supported platforms.
135+
`execvpe` is no longer supported, but this was already broken and will be added back in the next
136+
release. ([#681](https://github.com/nix-rust/nix/pull/561))
137+
- Removed `ioc_*` functions and many helper constants and macros within the `ioctl` module. These
138+
should always have been private and only the `ioctl!` should be used in public code.
139+
([#670](https://github.com/nix-rust/nix/pull/670))
53140

54141
### Fixed
55142
- Fixed multiple issues compiling under different archetectures and OSes.
@@ -68,6 +155,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
68155
([#623](https://github.com/nix-rust/nix/pull/623))
69156
- Multiple constants related to the termios API have now been properly defined for
70157
all supported platforms. ([#527](https://github.com/nix-rust/nix/pull/527))
158+
- `ioctl!` macro now supports working with non-int datatypes and properly supports all platforms.
159+
([#670](https://github.com/nix-rust/nix/pull/670))
71160

72161
## [0.8.1] 2017-04-16
73162

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
```

Cargo.toml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
name = "nix"
44
description = "Rust friendly bindings to *nix APIs"
5-
version = "0.9.0-pre"
5+
version = "0.10.0-pre"
66
authors = ["The nix-rust Project Developers"]
7-
homepage = "https://github.com/nix-rust/nix"
87
repository = "https://github.com/nix-rust/nix"
98
license = "MIT"
109
categories = ["os::unix-apis"]
@@ -15,14 +14,8 @@ exclude = [
1514
"test/**/*"
1615
]
1716

18-
[features]
19-
eventfd = []
20-
execvpe = []
21-
preadv_pwritev = []
22-
signalfd = []
23-
2417
[dependencies]
25-
libc = "0.2.25"
18+
libc = { git = "https://github.com/rust-lang/libc" }
2619
bitflags = "0.9"
2720
cfg-if = "0.1.0"
2821
void = "1.0.2"
@@ -39,10 +32,8 @@ name = "test"
3932
path = "test/test.rs"
4033

4134
[[test]]
42-
name = "test-signalfd"
43-
path = "test/test_signalfd.rs"
44-
harness = false
45-
test = true
35+
name = "test-aio-drop"
36+
path = "test/sys/test_aio_drop.rs"
4637

4738
[[test]]
4839
name = "test-mount"

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ Tier 1:
5757
* i686-unknown-linux-gnu
5858
* i686-unknown-linux-musl
5959
* mips-unknown-linux-gnu
60+
* mips64-unknown-linux-gnuabi64
61+
* mips64el-unknown-linux-gnuabi64
6062
* mipsel-unknown-linux-gnu
61-
* powerpc-unknown-linux-gnu
6263
* powerpc64-unknown-linux-gnu
6364
* powerpc64le-unknown-linux-gnu
6465
* x86_64-apple-darwin
@@ -70,29 +71,26 @@ Tier 2:
7071
* aarch64-apple-ios
7172
* aarch64-linux-android
7273
* arm-linux-androideabi
74+
* arm-unknown-linux-musleabi (requires Rust >= 1.14)
7375
* armv7-apple-ios
7476
* armv7-linux-androideabi
7577
* armv7s-apple-ios
7678
* i386-apple-ios
7779
* i686-linux-android (requires Rust >= 1.18)
7880
* i686-unknown-freebsd
81+
* powerpc-unknown-linux-gnu
82+
* s390x-unknown-linux-gnu
7983
* x86_64-apple-ios
8084
* x86_64-linux-android (requires Rust >= 1.18)
8185
* x86_64-unknown-netbsd
8286

83-
Tier 3:
84-
* arm-unknown-linux-musleabi (requires Rust >= 1.14)
85-
* mips64-unknown-linux-gnuabi64
86-
* mips64el-unknown-linux-gnuabi64
87-
* s390x-unknown-linux-gnu
88-
8987
## Usage
9088

9189
To use `nix`, first add this to your `Cargo.toml`:
9290

9391
```toml
9492
[dependencies]
95-
nix = "0.8.0"
93+
nix = "0.9.0"
9694
```
9795

9896
Then, add this to your crate root:

bors.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Gate on Travis CI and Buildbot
22
status = ["continuous-integration/travis-ci/push",
3-
"buildbot/nix-rust/nix fbsd11"]
3+
"buildbot/nix-rust/nix amd64_fbsd11",
4+
"buildbot/nix-rust/nix i386_fbsd11"]
45

56
# Set bors's timeout to 4 hours
67
#

0 commit comments

Comments
 (0)