summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-01-26Auto merge of #483 - asomers:aio2, r=posborneHomu
Add POSIX AIO support POSIX AIO is a standard for asynchronous file I/O. Read, write, and fsync operations can all take place in the background, with completion notification delivered by a signal, by a new thread, by kqueue, or not at all. The SigEvent class, used for AIO notifications among other things, is also added.
2017-01-25Add PhantomData to AioCb to track buffer's lifetimeAlan Somers
2017-01-19unistd: add fchdir(2)Luca Bruno
This introduces a wrapper for fchdir(2), allowing a process to change directory based on an open file descriptor. The underlying function is available in libc crate since 0.2.20.
2016-12-19fix all and update CHANGELOG.mdqupeng
2016-12-19Merge branch 'nix-rust'qupeng
2016-12-16Add POSIX AIO supportAlan Somers
POSIX AIO is a standard for asynchronous file I/O. Read, write, and fsync operations can all take place in the background, with completion notification delivered by a signal, by a new thread, by kqueue, or not at all. This commit supports all standard AIO functions. However, lio_listio is disabled on macos because it doesn't seem to work, even though the syscall is present. The SigEvent class, used for AIO notifications among other things, is also added. Also, impl AsRef for TimeVal and TimeSpec
2016-12-12epoll: improve EpollEvent::empty() by using mem::uninitialized.qupeng
2016-12-11test/mod.rs: only test epoll on linux.qupeng
2016-12-11fix #480 and add simple test cases for that.qupeng
r? @fiveop
2016-12-10Add support for system control sockets for XNUConrad Kramer
2016-12-10Add ioctl support for BSDConrad Kramer
2016-11-19Add TimeSpec, a Newtype around libc::timespecAlan Somers
Also, add trait TimeValLike, so some code can be shared between TimeSpec and TimeVal.
2016-11-18Improve portability of test_getsocknameAlan Somers
test_getsockname used an IPv4 socket and assumed that localhost was "127.0.0.1". But that assumption doesn't hold on IPv6-only hosts or on shared-IP FreeBSD jails. Unfortunately, the Rust standard library doesn't provide a good way to resolve localhost. So change the test to use a unix-domain socket instead.
2016-11-18Fix Unix domain sockets.Alan Somers
There were multiple errors regarding Unix domain sockets: * UnixAddr::path assumed that gethostbyname and similar functions would include the terminating null as part of len. That is not universally true. In fact, POSIX only guarantees that len will be at least large enough to store the non-null-terminated path. So it could be larger or smaller than nix was assuming. Since abstract sockets' paths are not strings, we can't modify gethostbyname. Instead, I implemented the fix in UnixAddr::path and UnixAddr::new. I clarified the documentation too. * SockAddr::as_ffi_pair contained a Linuxism. * sockaddr_storage_to_addr forgot to adjust sun_len when creating a UnixAddr
2016-11-16Fix intermittency in test_selectAlan Somers
Sometimes, on a heavily laden system, select would timeout and the test would fail. Fix it by lengthening the timeout to 10s.
2016-11-15Auto merge of #466 - fiveop:warnings, r=posborneHomu
Get rid of a few test compilation warnings Cleans up after 0fa7250b9575a2746519a854d0138c4c8255f109 and 40351db00da6ee8c904f47599ee692a85e3d96ef.
2016-11-14Get rid of a few test compilation warningsPhilipp Matthias Schaefer
2016-11-14Make signal argument to kill optionalPhilipp Matthias Schaefer
2016-11-13Avoid TempDir::into_path(), because it doesn't cleanup on DropAlan Somers
2016-10-24mount: Run test_mount_bind in CIKamal Marhubi
Looks like Travis allows bind mounts in their container infra now.
2016-10-23use tempfile in test_pwrite.Alan Somers
2016-09-28Apparently not all mkstemp implementation require the X at the end (despite ↵Philipp Keller
its documentation\!), checking the failure of a directory now
2016-09-27test also that mkstemp fails when there's no X at the endPhilipp Keller
2016-09-16made it running with rust 1.2, added documentation to mkstempPhilipp Keller
2016-09-08Auto merge of #416 - philippkeller:master, r=posborneHomu
add unistd::getcwd and unistd::mkdir As a (late) followup of [this withdrawn PR](https://github.com/rust-lang/libc/pull/326) I have added getcwd (wrapper around `libc::getcwd`) and mkdir (wrapper around `libc::mkdir`) and added testing. A few notes: - I'm new to rust so I would appreciate some pair of eyes testing the code, plus I'm open for revision of code or general remarks about my coding style - I have run the tests both on OSX as on Linux (Ubuntu) - I've run `clippy` to see if my code is well formatted, however clippy issues many warnings about the project. I think I didn't add any more warnings - the methods in unistd are not documented so I also left out the documentation of `getcwd` and `mkdir`, although I think it'd probably be good to add some documentation, especially some example code how to use the methods - the base idea of `getcwd` is [taken from std](https://github.com/rust-lang/rust/blob/1.9.0/src/libstd/sys/unix/os.rs#L95-L119), should I mention that somewhere?
2016-09-07fixed indentationPhilipp Keller
2016-09-06added documentation for getcwd and mkdir, changed test so that it compares ↵Philipp Keller
against std::env::current_dir
2016-09-06made it running with rust 1.2.0: the code for getcwd is now an exact copy of ↵Philipp Keller
the implementation in std
2016-09-05implemented mkdir, extended getcwd test to include long path namesPhilipp Keller
2016-09-03added test for getcwd, still not complete (needs to check also longer ↵Philipp Keller
directory names, need to be created with mkdir first which doesn't exist yet)
2016-09-02implemented getcwd (returning Result<PathBuf>, reconciling all calls to ↵Philipp Keller
expect into proper try handling), needs testing still
2016-09-01Auto merge of #392 - fiveop:less_ffi, r=@fiveopHomu
Replace ffi module by libc functions in mqueue.rs This is almost finished. I still need to check if I introduced any breaking changes by changing signatures. I would want to record this in the change log, however, for that we still need to merge #391. - [x] update change log - [x] run rustfmt on `src/mqueue.rs`
2016-08-31Replace ffi module by libc functions in mqueue.rsPhilipp Matthias Schaefer
2016-08-31Use libc in poll.rsPhilipp Matthias Schaefer
2016-08-15Get rid of a few warnings during compilation of testsPhilipp Matthias Schaefer
2016-06-13Added lseek to unistdAndrei Oprisan
llseek and lseek64 impl Whence fixed formatting awful typo when refactoring no llseek wrong test name using off64_t got rid of offset Added SeekHole/Data; formatted test; SeekCur/Set/End use libc constants
2016-05-01Return both the fd and the created pathAndreas Fuchs
2016-05-01Remove dependency on Result::expectAndreas Fuchs
2016-05-01Add mkstemp(3)Andreas Fuchs
2016-03-31Auto merge of #332 - kamalmarhubi:fork-enum, r=fiveopHomu
unistd: Redesign the enum returned by fork() This changes the name of the enum returned by `fork()` to `ForkResult`, and changes the `Parent` variant to be struct-like. The result can be matched like use nix::unistd::ForkResult::*; match fork().unwrap() { Parent { child } => { ... } Child => { ... } } using the shorthand matching syntax for struct-like enum variants. This is a breaking change.
2016-03-30unistd: Redesign the enum returned by fork()Kamal Marhubi
This commit changes the name of the enum returned by `fork()` to `ForkResult`, and changes the `Parent` variant to be struct-like. The result can be matched like use nix::unistd::ForkResult::*; match fork().unwrap() { Parent { child } => { ... } Child => { ... } } using the shorthand matching syntax for struct-like enum variants. This is a breaking change.
2016-03-30socket: Respect IPv6 flowinfo and scope_id in InetAddr::from_stdKamal Marhubi
Fixes #329
2016-03-30Use pause(2) in test_wait_signalKamal Marhubi
Replace a busy loop with a call to `pause(2)`.
2016-03-21Use getuid(2) from nix instead of libc in test_mountKamal Marhubi
2016-03-21mount: Do not treat unshare(2) failure as test failureKamal Marhubi
The mount test runner uses unprivileged user namespaces. Previously, failure from `unshare(2)` to create the user namespace would fail the test. This changes that to simply print an error and exit successfully. Refs https://github.com/nix-rust/nix/pull/326
2016-03-10update signalfd to use libc typesAlex Gulyás
2016-03-07Add gettidDave Hylands
2016-02-20Auto merge of #271 - abbradar:mqueue-fixes, r=kamalmarhubiHomu
mqueue: change types to allow more cases Part of https://github.com/nix-rust/nix/pull/270, fixed according to @kamalmarhubi's comments.
2016-02-20mqueue: change types to allow more casesNikolay Amiantov
2016-02-20select: allow infinite timeoutNikolay Amiantov