Auto merge of #1432 - josephlr:errno, r=gnzlbg
Add __errno_location on Redox, DragonFlyBSD, Haiku Currently [`libstd`](https://github.com/rust-lang/rust/blob/909f5a049415a815b23502a5498de9a99bbf276b/src/libstd/sys/unix/os.rs#L29-L49) and the [`getrandom` crate](https://github.com/rust-random/getrandom/pull/54/files#diff-027a56068e2bf3d31dc4273ee6e07034R12) have to use external declarations in order to implement `errno_location` across all UNIX platforms. This change adds bindings for the remaining UNIX platforms, allowing everyone to just use normal `libc` bindings. This also removes the need for a seperate [`errno-dragonfly`](https://crates.io/crates/errno-dragonfly) crate. Links to the relevant header files: - Redox: [`relibc`'s `bits/errno.h`](https://github.com/redox-os/relibc/blob/master/include/bits/errno.h) uses `__errno_location` - Haiku: [`posix/errno.h`](https://github.com/luciang/haiku/blob/master/headers/posix/errno.h) uses `_errnop` - DragonFlyBSD: [`sys/errno.h`](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/errno.h) uses `__error` just like FreeBSD (which makes sense) - Note that the `__error` function is inlined. I don't think this causes a problem.
Showing
- build.rs 9 additions, 5 deletionsbuild.rs
- src/lib.rs 1 addition, 0 deletionssrc/lib.rs
- src/unix/bsd/freebsdlike/dragonfly/errno.rs 12 additions, 0 deletionssrc/unix/bsd/freebsdlike/dragonfly/errno.rs
- src/unix/bsd/freebsdlike/dragonfly/mod.rs 7 additions, 0 deletionssrc/unix/bsd/freebsdlike/dragonfly/mod.rs
- src/unix/haiku/mod.rs 1 addition, 0 deletionssrc/unix/haiku/mod.rs
- src/unix/redox/mod.rs 1 addition, 0 deletionssrc/unix/redox/mod.rs
Loading
Please register or sign in to comment