summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #313 - alexcrichton:bump, r=alexcrichton0.2.12bors2016-06-102-3/+3
|\ | | | | | | Bump to 0.2.12
| * Bump to 0.2.12Alex Crichton2016-06-102-3/+3
| |
* | Auto merge of #307 - darnuria:relative-directory-posix2008-api, r=alexcrichtonbors2016-06-107-0/+150
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Directory file descriptor relative syscall. Add Directory file descriptor relative syscall. I only added "*at" syscall relative to Posix2008 specification. At the moment OSX and Android are partially supporting this API. This include: * `openat` * `faccessat` * `fchmodat` * `fchownat` * `fstatat` * `linkat` * `mkdirat` * `mknodat` [0] * `readlinkat` * `renameat` * `symlinkat` * `unlinkat` * `mkfifoat` [0][1] [1] Not available on Android at the moment: * `mkfifo` [1] Not available on OSX at the moment: * `mkfifoat` * `mknodat` And exclude operating system specific API: * `renameat2`: Linux specific * `execveat`: Linux specific since 3.19 * `futimesat`: GNU extension * `name_to_handle_at`: GNU extension * `scandirat`: GNU extension * `fanotify_mark`: belong to fanotify API.
| * Add Directory file descriptor relative syscall.Axel Viala2016-06-107-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I only added "*at" syscall relative to Posix2008 specification. At the moment OSX and Android are partially supporting this API. This include: * `openat` * `faccessat` * `fchmodat` * `fchownat` * `fstatat` * `linkat` * `mkdirat` * `mknodat` [0] * `readlinkat` * `renameat` * `symlinkat` * `unlinkat` * `mkfifoat` [0][1] [1] Not available on Android at the moment: * `mkfifo` [1] Not available on OSX at the moment: * `mkfifoat` * `mknodat` And exclude operating system specific API: * `renameat2`: Linux specific * `execveat`: Linux specific since 3.19 * `futimesat`: GNU extension * `name_to_handle_at`: GNU extension * `scandirat`: GNU extension * `fanotify_mark`: belong to fanotify API.
* | Auto merge of #312 - nbaksalyar:master, r=alexcrichtonbors2016-06-101-0/+8
|\ \ | | | | | | | | | | | | | | | Fix semaphores on Solaris/Illumos This adds `sem_t` structure introduced in https://github.com/rust-lang/libc/pull/309 and fixes compilation on Solaris.
| * | Fix compilation on Solaris/IllumosNikita Baksalyar2016-06-101-0/+8
|/ /
* | Auto merge of #310 - nrc:WIF, r=alexcrichtonbors2016-06-094-8/+52
|\ \ | | | | | | | | | | | | | | | Add more constants from sys/wait.h And fix WIFEXITED on Linux, which seemed to be wrong.
| * | Add more constants from sys/wait.hNick Cameron2016-06-084-8/+52
|/ / | | | | | | And fix WIFEXITED on Linux, which seemed to be wrong.
* | Auto merge of #309 - sfackler:sem, r=alexcrichtonbors2016-06-0611-0/+70
|\ \ | | | | | | | | | Add semaphore APIs
| * | Add semaphore APIsSteven Fackler2016-06-0511-0/+70
|/ /
* | Auto merge of #299 - lemonrock:sched_getcpu, r=alexcrichtonbors2016-06-012-0/+2
|\ \ | |/ |/| | | | | | | Adding sched_getcpu() for Android and Linux None
| * Removing sched_getcpu for musl as no current releases support itRaphael Cohn2016-06-013-1/+2
| |
| * Merge remote-tracking branch 'upstream/master' into sched_getcpuRaphael Cohn2016-06-013-90/+90
| |\ | |/ |/|
* | Auto merge of #301 - Amanieu:musl_ioctl, r=alexcrichtonbors2016-05-313-90/+90
|\ \ | | | | | | | | | | | | | | | Fix ioctl types for non-x86 musl This fixes up #289 by changing the type for other platforms as well.
| * | Fix ioctl types for non-x86 muslAmanieu d'Antras2016-05-303-90/+90
|/ /
| * Merge remote-tracking branch 'upstream/master' into sched_getcpuRaphael Cohn2016-05-2817-0/+63
| |\ | |/ |/|
* | Auto merge of #300 - rrichardson:master, r=alexcrichtonbors2016-05-2712-0/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | added const SOCK_SEQPACKET, and SOCK_RDM where applicable ... which is used for UNIX Seqpacket sockets as well as SCTP IP. I have verified in source on a couple Linux flavours as well as freebsd and darwin source that SOCK_SEQPACKET has value 5. Solaris is the odd one with a value of 6. I also added RDM for solaris (value 5)
| * | added const SOCK_SEQPACKET, which is used for unix seqpacket sockets as well ↵Rick Richardson2016-05-2712-0/+13
|/ / | | | | | | as SCTP IP
* | Auto merge of #294 - lemonrock:getpriority, r=alexcrichtonbors2016-05-2511-0/+50
|\ \ | | | | | | | | | | | | | | | Added nice, setpriority and getpriority along with constants and type… … definitions
| * \ Adjustments for latest mergeRaphael Cohn2016-05-2511-5/+39
| |\ \
| * | | Changing android to not use id_tRaphael Cohn2016-05-211-2/+18
| | | |
| * | | Add the TIOCGWINSZ and TIOCSWINSZ constantsSeveren Redwood2016-05-201-0/+3
| | | |
| * | | Redefining id_t because it is differently sized and has a different meaning ↵Raphael Cohn2016-05-204-3/+9
| | | | | | | | | | | | | | | | across BSD platforms
| * | | glibc defines __priority_which_t two different waysRaphael Cohn2016-05-201-1/+1
| | | |
| * | | Added nice, setpriority and getpriority along with constants and type ↵Raphael Cohn2016-05-208-0/+29
| | | | | | | | | | | | | | | | definitions
| | | * Merged masterRaphael Cohn2016-05-258-0/+106
| | | |\ | |_|_|/ |/| | |
* | | | Auto merge of #288 - lemonrock:sysinfo, r=alexcrichtonbors2016-05-258-0/+106
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Adding sysinfo() and sysinfo struct for Linux and Android. Sadly, the sysinfo struct varies slightly between Musl and Glibc / Bionic. This means that users need to be careful when using the uptime, and should always cast it to a signed value. Why uptime can be signed is beyond me...
| * | | Merge branch 'master' into sysinfoRaphael Cohn2016-05-259-0/+35
| |\ \ \ | |/ / / |/| | |
| * | | Merge branch 'master' into sysinfoRaphael Cohn2016-05-2015-85/+922
| |\ \ \
| * | | | Adding sysinfo() and sysinfo struct for Linux and Android.Raphael Cohn2016-05-208-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sadly, the sysinfo struct varies slightly between Musl and Glibc / Bionic. This means that users need to be careful when using the uptime, and should always cast it to a signed value. Why uptime can be signed is beyond me...
| | | | * Adding sched_getcpu() for Android and LinuxRaphael Cohn2016-05-251-0/+1
| |_|_|/ |/| | |
* | | | Auto merge of #297 - Amanieu:mutex_types, r=alexcrichtonbors2016-05-228-0/+29
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Add pthread mutex type constants These are needed to create a pthread mutex that doesn't use lock elision on glibc.
| * | | | Add pthread mutex type constantsAmanieu d'Antras2016-05-218-0/+29
| | |/ / | |/| |
* | | | Auto merge of #298 - peterhj:peterhj-pthread-affinity, r=alexcrichtonbors2016-05-221-0/+6
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | linux: Support getting and setting the cpu affinity for the current pthread. This implements `pthread_getaffinity_np` and `pthread_setaffinity_np` for linux.
| * | | linux: Support getting and setting the cpu affinity for the currentPeter Jin2016-05-211-0/+6
|/ / / | | | | | | | | | pthread.
* | | Auto merge of #293 - SShrike:freebsd-ioctl-constants, r=alexcrichtonbors2016-05-191-0/+3
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Add the TIOCGWINSZ and TIOCSWINSZ constants I've added the `TIOCGWINSZ` and `TIOCSWINSZ` constants/ioctl control codes. I wasn't quite sure where to put them, so hopefully they're in the right place. As of now it's set to compile on 'FreeBSD-like' platforms, so it will compile on both FreeBSD *and* DragonflyBSD. I've only tested it on FreeBSD though, but it should also work on DragonflyBSD AFAIK. Fixes #292.
| * | Add the TIOCGWINSZ and TIOCSWINSZ constantsSeveren Redwood2016-05-191-0/+3
|/ /
* | Auto merge of #289 - fnichol:fix-musl-ioctl-constants, r=alexcrichtonbors2016-05-183-61/+61
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix ioctl constants for musl target envs. Heya! I ran across this issue today while trying to build a portable static binary using the `x86_64-unknown-linux-musl` target. Took a bit of digging to make sure I understood what was going on, and while I may still be off the mark, I believe this is a fix to my issue. Thanks!! ---- According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
| * | Fix ioctl constants for musl target envs.Fletcher Nichol2016-05-153-61/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to musl's source, the `ioctl` [function signature][musl-ioctl-h] takes an `int` as the request argument (i.e. an `i32`) which is reflected in this crate's [ioctl binding][musl-ioctl-rs]. It looks like when the ioctl constants were added that [glibc's default][glibc-ioctl-h] of a `c_ulong` type was used for the musl values as well, rather than a `c_int` type. This change updates these constants to a `c_int` so that they match the expected function call type. Here is a minimal reproduction of the issue. Given this Rust program: ```rust extern crate libc; use libc::{ioctl, winsize, STDOUT_FILENO, TIOCGWINSZ}; fn main() { let mut wsize = winsize { ws_row: 0, ws_col: 0, ws_xpixel: 0, ws_ypixel: 0, }; unsafe { ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); } println!("Sizes: {{ rows: {}, cols: {}, xpixel: {}, ypixel: {} }}", wsize.ws_row, wsize.ws_col, wsize.ws_xpixel, wsize.ws_ypixel); } ``` When run against the `x86_64-unknwon-linux-gnu` and `x86_64-unknown-linux-musl` targets, we see the difference in behavior: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) src/main.rs:13:30: 13:40 error: mismatched types: expected `i32`, found `u64` [E0308] src/main.rs:13 ioctl(STDOUT_FILENO, TIOCGWINSZ, &mut wsize); ^~~~~~~~~~ src/main.rs:13:30: 13:40 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error Could not compile `libc-musl-ioctl`. To learn more, run the command again with --verbose. ``` Working against this fix: ``` > cargo clean > cargo run --target=x86_64-unknown-linux-gnu Updating git repository `https://github.com/fnichol/rust-lang-libc.git` Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-gnu/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } > cargo clean > cargo run --target=x86_64-unknown-linux-musl Compiling libc v0.2.11 (https://github.com/fnichol/rust-lang-libc.git?branch=fix-musl-ioctl-constants#3285f387) Compiling libc-musl-ioctl v0.1.0 (file:///src/libc-musl-ioctl) Running `target/x86_64-unknown-linux-musl/debug/libc-musl-ioctl` Sizes: { rows: 28, cols: 211, xpixel: 0, ypixel: 0 } ``` [musl-ioctl-rs]: https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/fn.ioctl.html [musl-ioctl-h]: https://git.musl-libc.org/cgit/musl/tree/include/sys/ioctl.h [glibc-ioctl-h]: http://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/include/sys/ioctl.h
* | | Auto merge of #291 - alexcrichton:readd-hw-ncpu, r=alexcrichtonbors2016-05-161-0/+2
|\ \ \ | |/ / |/| | | | | | | | | | | Add back HW_NCPU Removed by accident in #285
| * | Add back HW_NCPUAlex Crichton2016-05-161-0/+2
|/ / | | | | | | Removed by accident in #285
* | Auto merge of #287 - alexcrichton:no-util-on-musl, r=alexcrichtonbors2016-05-143-1/+2
|\ \ | | | | | | | | | Don't link util on musl, consolidate #[link]
| * | Don't link util on musl, consolidate #[link]Alex Crichton2016-05-123-1/+2
| | |
* | | Auto merge of #285 - lemonrock:sysctl, r=alexcrichtonbors2016-05-139-23/+854
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | Added extensive constants to make use of the BSD's sysctl function. sysctl usage does differ significantly across the BSDs, and, whilst some constants overlap, many do not. It is easier to maintain them in separate modules, rather than trying to tease out common definitions.
| * | Merge branch 'master' into sysctlRaphael Cohn2016-05-133-1/+15
| |\ \ | |/ / |/| |
* | | Auto merge of #283 - jvns:add_process_vm_readv, r=alexcrichtonbors2016-05-121-0/+12
|\ \ \ | |_|/ |/| | | | | Add notbsd process_vm_readv and process_vm_writev system calls
| * | Add process_vm_readv and process_vm_writev system callsJulia Evans2016-05-121-0/+12
|/ /
* | Auto merge of #284 - lemonrock:getloadavg, r=alexcrichtonbors2016-05-113-1/+3
|\ \ | | | | | | | | | | | | | | | Added getloadavg for Linux, the BSDs and Solaris. Sadly Android's bionic lacks this functionality.
| * | Added getloadavg for Linux, the BSDs and Solaris.Raphael Cohn2016-05-113-1/+3
|/ / | | | | | | Sadly Android's bionic lacks this functionality.
| * Added extensive constants to make use of the BSD's sysctl function.Raphael Cohn2016-05-139-23/+854
|/ | | | | | sysctl usage does differ significantly across the BSDs, and, whilst some constants overlap, many do not. It is easier to maintain them in separate modules, rather than trying to tease out common definitions.