summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-04-15Add AioCb::from_boxed_sliceAlan Somers
The existing AioCb constructors work for simple programs where everything is stored on the stack. But in more complicated programs the borrow checker can't prove that a buffer will outlive the AioCb that references it. Fix this problem by introducting AioCb::from_boxed_slice, which takes a reference-counted buffer. Fixes #575
2017-04-15tests should protect concurrent access to signal handlersAlan Somers
Adds a mutex to protect access to SIGUSR2 signal handlers by the AIO tests. Fixes #578
2017-04-09Fixed failing ioctl tests.Zac Berkowitz
2017-03-22add support `readlink|readlinkat`Jörg Thalheim
2017-03-21add support for `fstatat`Jörg Thalheim
2017-03-21add support for `openat`Jörg Thalheim
2017-03-02Remove revents from PollFd::newBryant Mairs
revents is an output field so regardless of what value it is set to it will be overwritten by many of the function calls that take a PollFd. The only value that makes sense for the caller to pass in in `EventFlags::empty()` so we just hardcode that instead of making the caller do it.
2017-02-24impl Debug for AioCb and SigevNotifyAlan Somers
Also, fix style bug in AIO tests
2017-02-05Implement Drop for AioCbAlan Somers
If an AioCb has any in-kernel state, AioCb.drop will print a warning and wait for it to complete.
2017-02-05Add runtime checks to AioCb methodsAlan Somers
Prevent immutable buffers from being used with aio_read or lio_listio with LIO_READ. AioCb.from_slice no longer needs to be unsafe.
2017-01-26Turn most aio functions into AioCb methodsAlan Somers
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