- May 22, 2016
-
-
Peter Jin authored
pthread.
-
- 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
-
- May 13, 2016
-
-
Alex Crichton authored
-
- May 12, 2016
-
-
Julia Evans authored
-
- May 11, 2016
-
-
Raphael Cohn authored
Sadly Android's bionic lacks this functionality.
-
- May 10, 2016
-
-
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
-
-
Nerijus Arlauskas authored
-
- May 07, 2016
-
-
Philipp Matthias Schaefer authored
-
Philipp Matthias Schaefer authored
-
- May 05, 2016
-
-
Kamal Marhubi authored
This is the maximum size of guaranteed-atomic writes to a pipe.
-
Raphael Cohn authored
This is because Android bionic doesn't support `LOG_NFEATURES`.
-
Raphael Cohn authored
Removed CODE, as its definition and name varies too wildy and I have no current code using it to test permutations with. Moved LOG_NFACILITIES down, as Mac OS X defines this value differently. Added Mac OS X specific LOG_* facilities. Added FreeBSD / DragonFly BSD specific LOG_* facilities. Moved LOG_PERROR down, as all platforms bar Solaris define this. Moved LOG_CRON down, as Solaris defines this with a different value. Moved LOG_AUTHPRIV and LOG_FTP down, as all platforms bar Solaris define these. Looks like Solaris is suffering from the bit rot of commercial Unix...
-
- May 04, 2016
-
-
Raphael Cohn authored
-
- Apr 29, 2016
-
-
Kamal Marhubi authored
As with `getrlimit` and `setrlimit`, the glibc wrappers have a non-`int` for the `resource` argument, eg: extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) __THROW;
-
- Apr 28, 2016
-
-
Kamal Marhubi authored
A bunch of definitions were duplicated across, eg, android and linux. This commit pulls these up to higher levels where they can be shared.
-
- Apr 16, 2016
-
-
Timon Van Overveldt authored
These targets will be similar to the x86_64-unknown-linux-musl target, in that they'll use MUSL libc to allow fully static binaries to be generated. To remain consistent with the naming of existing ARM targets, as well as with the standard naming of MUSL toolchains, we'll use `musleabi` and `musleabihf` as the target environment names (analogous to `gnueabi` and `gnueabihf`). Most of these changes just extend the special casing for x86_64 MUSL targets to the ARM ones as well.
-
- Apr 15, 2016
-
-
Philipp Matthias Schaefer authored
-
- Apr 12, 2016
-
-
Greg V authored
-
- Apr 10, 2016
-
-
NODA, Kai authored
Signed-off-by:
NODA, Kai <nodakai@gmail.com>
-
- Apr 05, 2016
-
-
A.J. Gardner authored
There are many constants defined by langinfo, but we have the new types, locale_t and nl_item. We also have several functions, not all of which exist for every platform: nl_langinfo nl_langinfo_l newlocale duplocale freelocale uselocale querylocale
-
- Apr 04, 2016
-
-
Alex Crichton authored
-
- Apr 03, 2016
-
-
NODA, Kai authored
Signed-off-by:
NODA, Kai <nodakai@gmail.com>
-
- Apr 02, 2016
-
-
Kamal Marhubi authored
The functions were added for Apple in #202. Adding them to other platforms was pending an amendment to RFC 1291 to expand the scope of libc to include libutil. The amendment was merged as https://github.com/rust-lang/rfcs/pull/1529
-
- Mar 31, 2016
-
-
A.J. Gardner authored
Linux-likes have more locale categories than the BSDs (except for musl). We define the common set of categories at the src/unix/notbsd/mod.rs level, and leave the rest to the platform-specific modules.
-
A.J. Gardner authored
-
- Mar 30, 2016
-
-
A.J. Gardner authored
We have lconv struct, setlocale(), and localeconv(). Constants live under notbsd for now.
-
- Mar 18, 2016
-
-
Kamal Marhubi authored
Also move F_DUPFD_CLOEXEC up a level as it is available on Android. This commit leaves file sealing related fcntls and bitflag constants out, as they are defined in `linux/fcntl.h` rather than `fcntl.h`. They can be included once an approach for verification has been figured out. See #235 for more detail.
-
- Mar 14, 2016
-
-
Kamal Marhubi authored
These flags are available on Android.
-
Kamal Marhubi authored
They have different types and should be visually separated for ease of reading.
-
- Mar 13, 2016
-
-
Kamal Marhubi authored
The flags are available in Android, and should be defined higher up.
-
- Mar 12, 2016
-
-
Paul Osborne authored
The addition of sockaddr_nl seems to be a fairly recent addition to bionic, although it would appear that its lack of presence in previous versions is more of an oversight than anything else. https://github.com/android/platform_bionic/blob/831c8a52498d3c7be204a00847275f6e9163626f/libc/kernel/uapi/linux/netlink.h#L54 This change is motivated by failures to build nix under Android. Signed-off-by:
Paul Osborne <osbpau@gmail.com>
-
- Mar 11, 2016
-
-
Kamal Marhubi authored
This commit changes most uses of cfg_if as follows: - fallthrough `else` usage is avoided for architecture or OS specific items - a comment is added in the final `else` clause to signal intent someone modifying It is safer to omit items than include ones for the wrong platform or architecture.
-
- Mar 10, 2016
-
-
Kamal Marhubi authored
The associated `perf_event_attr` struct is not included as it contains unions and a bitfield making it unrepresentable in Rust. Additionally, it is not entirely stable, and has changed size several times.
-
Kamal Marhubi authored
-
- Mar 07, 2016
-
-
Gabriele Svelto authored
-
fpgaminer authored
-
- Mar 06, 2016
-
-
Dave Hylands authored
-
Alex Crichton authored
-
Jorge Aparicio authored
-
Jorge Aparicio authored
This is how MetadaExt expects these fields to be named. See https://github.com/rust-lang/rust/blob/c116ae35cf49b55bd8d82e31f1ba030cf7e63867/src/libstd/os/linux/fs.rs#L107-L121
-