Skip to content
Snippets Groups Projects
Commit 47535e6d authored by bors's avatar bors
Browse files

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.
parents 54b03c53 df34d17b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment