summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-08-29Clippy: silence a false-positive cast alignment warningAlan Somers
2019-08-29Clippy: remove unnecessary mem::transmuteAlan Somers
2019-08-29Clippy cleanupAlan Somers
2019-08-22updated changelogSendil Kumar
2019-08-22fix review commentsSendil Kumar
2019-08-22update readlink to return the path instead of mangling the bufferSendil Kumar
2019-08-22fix readlink/readlinkat to return too long only when it is longSendil Kumar
2019-07-17Add renameatScott Lamb
renameat is (somewhat oddly, imho) in stdio.h. I put it in nix::fcntl because there's no nix::stdio and all its friends (including the AT_* constants) are in nix::fcntl.
2019-07-16Merge #1058bors[bot]
1058: Implement unlinkat r=asomers a=jlb6740 This adds the unlinkat function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html and widely implmented on Unix-family platforms. Co-authored-by: Johnnie Birch <45402135+jlb6740@users.noreply.github.com>
2019-07-14Implement unlinkatJohnnie Birch
This adds the unlinkat function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html and widely implmented on Unix-family platforms. Implement unlinkat - Update comments to unlink at and breakup tests Changes made based on comments from pull request #1058 Implement unlinkat - Update should_panic for more precise check Updae should_panic attribute for more precise check. Also remove some dead code and note the pull request ID. Implement unlinkat - Update error handling to use unwrap_err The previous patch failed testing on two targets that returned EPERM as the Sys error instead of EISDIR. This patch changes from using the should_panic attribute to using the unwrap_err and matching against the result. Implement Unlinkat - Passing tests should not print anything. Fix. Implement unlinkat - Update location of commit comment in the CHANGELOG Implement unlinkat - Remove newline
2019-07-13Merge #1095bors[bot]
1095: Fix warnings on Rust 1.37.0 r=asomers a=asomers * Replace obsolete range syntax "..." with inclusive range "..=" * Use dyn Trait syntax instead of Box<Trait> * Raise MSRV to 1.27.0 (for dyn Trait syntax) * Test with nightly again Co-authored-by: Alan Somers <asomers@gmail.com>
2019-07-13Temporarily allow deprecated itemsAlan Somers
This fixes the tests on Rust 1.38.0. We'll fix them for real after release 0.15.0. Issue #1096
2019-07-13Fix warnings on Rust 1.37.0Alan Somers
* Replace obsolete range syntax "..." with inclusive range "..=" * Use dyn Trait syntax instead of Box<Trait> * Raise MSRV to 1.27.0 (for dyn Trait syntax) * Raise MSRV to 1.31.0 (because of rand) tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires 1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified as a target-specific dependency, but Cargo tries to build it anyway (only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
2019-07-12socket: add support for AF_VSOCKStefano Garzarella
This patch adds AF_VSOCK support to AddressFamily in order to use VSOCK socket. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2019-07-09implement posix_fadviseKevin Wern
2019-07-01Enable sched_yield for all *nix hostsJakub Konka
2019-07-01Move cross compilation cfg for sched into sched modJakub Konka
2019-06-20Merge #928bors[bot]
928: Wrap libc::statfs r=asomers a=alesharik Fix for [#926](https://github.com/nix-rust/nix/issues/926) Co-authored-by: alesharik <alesharikreserv@yandex.ru>
2019-06-15sys/stat: implement mkdiratKevin Wern
2019-06-12Update statfsalesharik
2019-06-12Implement `copy_file_range()`Árni Dagur
2019-06-11Use ptr::NonNull for DirBryant Mairs
This is a minor optimization that allows for reduced sizes of datatypes. Since this pointer will never be NULL, it's safe to use here
2019-06-11Fix tests for abstract socketsBryant Mairs
Abstract paths should always be N-1 in length where N is the length of the `sun_path` field (first byte is \0). Given that, `UnixAddr::new_abstract()` should always return this N-1 length, not just the length of the string provided (the rest of the array will be \0s).
2019-06-09Add extra traits for all typesBryant Mairs
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all traits are supported by all types, which is why many are missing some.
2019-06-07ifaddrs: add ifaddrs support for androidPaul Osborne
Support under bionic/android is the same as under Linux for what is exposed by this code. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2019-06-07socket: expose MSG_WAITALL in MsgFlagsStefano Garzarella
MSG_WAITALL can be useful with recv() to wait the full amount of data requested. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2019-06-06Fix the is_so_mark_functional test in Linux containersAlan Somers
It's not sufficient to check for root privileges. In a container, the euid may be root even though the user lacks some capabilities. Replace this test's root check with a check for the CAP_NET_ADMIN capability instead.
2019-06-03Check euid, not uid, for socket testsAlan Somers
2019-06-02Fix build on Android with recent libcAlan Somers
libc just changed the signedness of sigaction.sa_flags for Android. https://github.com/rust-lang/libc/commit/841b3eb01644283c3c41ac1d1a2ddcec141f15f2
2019-06-02Fix the build on Linux/mips with recent libcAlan Somers
libc just undefined MADV_SOFT_OFFLINE on mips. https://github.com/rust-lang/libc/pull/1365 Fixes #1074
2019-05-31fix more uintXY_t instancesJohannes Schilling
2019-05-31libc::uint32_t -> rust u32Johannes Schilling
2019-05-31libc::uint8_t deprecated in favor of rust u8Johannes Schilling
2019-05-24Allow import of Linux macros in Rust2018Bryant Mairs
Finish off the work started in 8c9ac5a70 allowing the use of macros without needing to import local inner macros.
2019-05-23Update fcntl.rsJakub Konka
Just a minor typo in the docs of `O_RDWR`. It read: ``` /// Allow both reading and writing. /// /// This should not be combined with `O_WRONLY` or `O_RDWR`. O_RDWR; ``` but I believe it should read ``` /// Allow both reading and writing. /// /// This should not be combined with `O_WRONLY` or `O_RDONLY`. O_RDWR; ``` instead :-)
2019-05-18Merge #1050bors[bot]
1050: Implement `sched_yield`. r=asomers a=sunfishcode This adds the `sched_yield` function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html and widely implemented on Unix-family platforms. Co-authored-by: Dan Gohman <sunfish@mozilla.com>
2019-05-17Implement `sched_yield`.Dan Gohman
This adds the `sched_yield` function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html and widely implemented on Unix-family platforms.
2019-05-17Remove a redundant "use libc"Alan Somers
2019-05-17Fix build on arm and s390x after recent libc changesAlan Somers
libc just removed some symbols on linux/arm32 and linux/s390x that never should've been defined in the first place. https://github.com/rust-lang/libc/commit/24f8972b8d2d915b1687fc8197e1ed95e349a82e https://github.com/rust-lang/libc/commit/d2695436ba5072078796c76f727a296e0f43caa6
2019-04-29Restored the bytes field on RecvMsg in order to know the amount of bytes ↵Vincent Dagonneau
received using recvmsg.
2019-04-23pty: Add forkptyKevin Kuehler
2019-04-21Remove duplicate use statements on macOS.Tom Pusateri
2019-04-20Add a access(2) wrapperjr
2019-04-14Merge #1044bors[bot]
1044: Add unistd::{seteuid,setegid} r=asomers a=jmmv This is for the benefit of those platforms that do not provide setresuid nor setresgid, like macOS. Co-authored-by: Julio Merino <julio@meroh.net>
2019-04-12Merge #1041bors[bot]
1041: allow importing macros without helpers in the 2018 edition r=asomers a=euclio ~This PR adds the `$crate::` prefix to all uses of helper macros, which will allow users of the 2018 edition to import the macros without needing to also import their helpers.~ See https://doc.rust-lang.org/edition-guide/rust-2018/macros/macro-changes.html#macros-with-crate-prefix for more info. ~While this is a cleaner solution than using `#[macro_export(local_inner_macros)]`, it also requires bumping the minimum supported compiler version to 1.30. If this is acceptable, I'll add a commit to update the Travis configuration and docs.~ This PR now uses `local_inner_macros` to preserve compatibility with the current minimum Rust version. Co-authored-by: Andy Russell <arussell123@gmail.com>
2019-04-11Add unistd::{seteuid,setegid}Julio Merino
This is for the benefit of those platforms that do not provide setresuid nor setresgid, like macOS.
2019-04-09Uncomment to_std and from_std methods for IpAddrrabbott99
2019-04-04export helper macros via `local_inner_macros`Andy Russell
This will allow users of the 2018 edition to import the macros without needing to also import their helpers.
2019-03-29add errno constants for OpenBSD 6.2 and format long linesJenn Wheeler
2019-03-28Add ENOTSUP to Linux and AndroidJulio Merino
While ENOTSUP is defined as equal to EOPNOTSUPP on these platforms, exposing the ENOTSUP symbol (as libc does) allows for writing portable code that may want to reference this error code.