- Jun 10, 2016
-
-
Axel Viala authored
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.
-
- May 31, 2016
-
-
bors authored
Fix ioctl types for non-x86 musl This fixes up #289 by changing the type for other platforms as well.
-
- May 30, 2016
-
-
Amanieu d'Antras authored
-
- May 27, 2016
-
-
bors authored
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)
-
Rick Richardson authored
-
- May 25, 2016
-
-
bors authored
Added nice, setpriority and getpriority along with constants and type… … definitions
-
bors authored
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...
-
Raphael Cohn authored
-
Raphael Cohn authored
-
- May 22, 2016
-
-
bors authored
Add pthread mutex type constants These are needed to create a pthread mutex that doesn't use lock elision on glibc.
-
bors authored
linux: Support getting and setting the cpu affinity for the current pthread. This implements `pthread_getaffinity_np` and `pthread_setaffinity_np` for linux.
-
Peter Jin authored
pthread.
-
- May 21, 2016
-
-
Raphael Cohn authored
-
Amanieu d'Antras authored
-
- May 20, 2016
-
-
Severen Redwood authored
-
Raphael Cohn authored
-
Raphael Cohn authored
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...
-
Raphael Cohn authored
-
Raphael Cohn authored
-
Raphael Cohn authored
-
- May 19, 2016
-
-
bors authored
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.
-
Severen Redwood authored
-
- May 18, 2016
-
-
bors authored
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
-
- May 16, 2016
-
-
bors authored
Add back HW_NCPU Removed by accident in #285
-
Alex Crichton authored
Removed by accident in #285
-
- May 15, 2016
-
-
Fletcher Nichol authored
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
-
bors authored
Don't link util on musl, consolidate #[link]
-
- May 14, 2016
-
-
bors authored
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.
-
- May 13, 2016
-
-
Raphael Cohn authored
-
Raphael Cohn authored
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.
-
Alex Crichton authored
-
- May 12, 2016
-
-
bors authored
Add notbsd process_vm_readv and process_vm_writev system calls
-
Julia Evans authored
-
- May 11, 2016
-
-
bors authored
Added getloadavg for Linux, the BSDs and Solaris. Sadly Android's bionic lacks this functionality.
-
Raphael Cohn authored
Sadly Android's bionic lacks this functionality.
-
- May 10, 2016
-
-
bors authored
Getprogname Added `getprogname()` and `setprogname()` for all BSDs and Solaris (including Mac OS X). Added `program_invocation_short_name` global, for Linux (glibc and Musl) which is effectively the same thing, and is what compatibility libraries like `libbsd` use to implement `getprogname()`. Added `__progname` global for Android, which, whilst not quite the same as `getprogname` or `program_invocation_short_name`, is better than using argv[0], as it (a) avoids a common bug with no arguments (b) avoids a common bug with a NULL string in argv[0] and (c) incorporates Android's chosen name for an unknown process.
-
Raphael Cohn authored
Adding program_invocation_short_name for Linux (Musl and glibc). Adding __progname for Android. This is a little different, but is a safer alternative to using argv[0], which may not exist, and includes Android's default application name (currently '<unknown>'). Adding these functions and externs means it is possible for all but Windows applications to safely discover their name, rather than rely on argv[0] parsing, /proc/self/exe, etc.
-
- May 08, 2016
-
-
bors authored
Refine defininition of mcontext_t on linux glibc x86-64 and x86.
-
bors authored
Add correctly sized structs and types for Android aarch64. So far both android x86_64 and aarch64 configurations used incorrect types from 32-bit architecture. This PR updates only the aarch64, because it is more common. The x86_64 may be also incorrect, but is out of scope of this PR.
-
Nerijus Arlauskas authored
-