Skip to content

Commit 1647189

Browse files
bors[bot]Al Hoang
and
Al Hoang
authored
Merge #1703
1703: add haiku support r=rtzoeller a=hoanga hello, the following changeset(s) adds support for compiling on haiku. below is an sample run showing compilation ```sh > uname -a Haiku shredder 1 hrev56040 Apr 22 2022 06:24:48 x86_64 x86_64 Haiku > cargo build Compiling autocfg v1.1.0 Compiling libc v0.2.123 Compiling bitflags v1.3.2 Compiling cfg-if v1.0.0 Compiling memoffset v0.6.5 Compiling nix v0.24.1 (/boot/home/src/git/rust-libs/nix) Finished dev [unoptimized + debuginfo] target(s) in 11.09s ``` and some results from running ```cargo test```: ```sh running 32 tests test sys::select::tests::fdset_clear ... ok test sys::select::tests::fdset_insert ... ok test sys::select::tests::fdset_highest ... ok test sys::select::tests::fdset_fds ... ok test sys::select::tests::fdset_remove ... ok test sys::signal::tests::test_clear ... ok test sys::select::tests::test_select ... ok test sys::select::tests::test_select_nfds2 ... ok test sys::signal::tests::test_contains ... ok test sys::select::tests::test_select_nfds ... ok test sys::signal::tests::test_extend ... ok test sys::signal::tests::test_from_and_into_iterator ... ok test sys::signal::tests::test_from_str_invalid_value ... ok test sys::signal::tests::test_from_str_round_trips ... ok test sys::signal::tests::test_sigaction ... ok test sys::signal::tests::test_sigwait ... ok test sys::signal::tests::test_thread_signal_set_mask ... ok test sys::statvfs::test::fstatvfs_call ... ok test sys::statvfs::test::statvfs_call ... ok test sys::termios::test::try_from ... ok test sys::signal::tests::test_thread_signal_swap ... ok test sys::signal::tests::test_thread_signal_block ... ok test sys::signal::tests::test_thread_signal_unblock ... ok test sys::time::test::test_timespec ... ok test sys::time::test::test_timespec_from ... ok test sys::time::test::test_timespec_neg ... ok test sys::time::test::test_timespec_fmt ... ok test sys::time::test::test_timespec_ord ... ok test sys::time::test::test_timeval ... ok test sys::time::test::test_timeval_neg ... ok test sys::time::test::test_timeval_fmt ... ok test sys::time::test::test_timeval_ord ... ok test result: ok. 32 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running test/test.rs (target/debug/deps/test-6e8a70ba3d8f7447) running 73 tests test sys::test_pthread::test_pthread_kill_none ... ok test sys::test_pthread::test_pthread_self ... ok test sys::test_select::test_pselect_nfds2 ... ok test sys::test_select::test_pselect ... ok test sys::test_signal::test_kill_none ... ok test sys::test_signal::test_killpg_none ... ok test sys::test_signal::test_old_sigaction_flags ... ok test sys::test_signal::test_signal ... ok test sys::test_signal::test_sigprocmask ... ok test sys::test_signal::test_signal_sigaction ... ok test sys::test_signal::test_sigprocmask_noop ... ok test sys::test_select::test_fdset_negative_fd::contains - should panic ... ok test sys::test_select::test_fdset_negative_fd::remove - should panic ... ok test sys::test_select::test_fdset_negative_fd::insert - should panic ... ok test sys::test_select::test_fdset_too_large_fd::contains - should panic ... ok test sys::test_select::test_fdset_too_large_fd::insert - should panic ... ok test sys::test_select::test_fdset_too_large_fd::remove - should panic ... ok test sys::test_wait::test_wait_exit ... ok test sys::test_wait::test_waitid_pid ... ok test sys::test_uio::test_readv ... ok test sys::test_wait::test_waitstatus_from_raw ... FAILED test sys::test_wait::test_waitstatus_pid ... ok test sys::test_uio::test_writev ... ok test test_net::test_if_nametoindex ... ok test test_dir::rewind ... ok test test_poll::test_pollfd_events ... ok test test_poll::test_pollfd_fd ... ok test sys::test_uio::test_pwrite ... ok test sys::test_uio::test_pread ... ok test test_fcntl::test_readlink ... ok test test_fcntl::test_openat ... ok test test_dir::read ... ok test test_stat::test_fstatat ... ok test test_stat::test_mkdirat_fail ... ok test test_time::test_clock_gettime ... ok test test_stat::test_fchmod ... ok test test_stat::test_fchmodat ... ok test test_time::test_clock_id_now ... ok test test_fcntl::test_renameat ... ok test test_stat::test_mkdirat_success_path ... ok test test_stat::test_stat_and_fstat ... ok test test_unistd::test_execvpe::test_cstr_ref ... ok test test_unistd::test_access_not_existing ... ok test test_unistd::test_execvpe::test_cstring ... ok test test_unistd::test_access_file_exists ... ok test test_stat::test_stat_fstat_lstat ... ok test test_unistd::test_fchdir ... ok test test_unistd::test_fork_and_waitpid ... ok test test_unistd::test_fchown ... ok test test_unistd::test_chown ... ok test test_unistd::test_getpid ... ok test test_unistd::test_getsid ... ok test test_unistd::test_fpathconf_limited ... ok test test_unistd::test_lseek ... ok test test_unistd::test_mkfifo_directory ... ok test test_unistd::test_fchownat ... ok test test_unistd::test_mkstemp_directory ... ok test test_unistd::test_pathconf_limited ... ok test test_unistd::test_pipe ... ok test test_unistd::test_sysconf_limited ... ok test test_unistd::test_mkfifo ... ok test test_unistd::test_ttyname_not_pty ... ok test test_unistd::test_ftruncate ... ok test test_unistd::test_mkstemp ... ok test test_poll::test_poll ... ok test test_unistd::test_wait ... ok test test_unistd::test_unlinkat_dir_removedir ... ok test test_unistd::test_unlinkat_file ... ok test test_unistd::test_unlinkat_dir_noremovedir ... ok test test_unistd::test_truncate ... ok test test_unistd::test_getcwd ... ok test test_unistd::test_alarm ... ok test test_unistd::test_canceling_alarm ... ok failures: ---- sys::test_wait::test_waitstatus_from_raw stdout ---- thread 'sys::test_wait::test_waitstatus_from_raw' panicked at 'assertion failed: `(left == right)` left: `Ok(Exited(Pid(1), 2))`, right: `Ok(Signaled(Pid(1), SIGINT, false))`', test/sys/test_wait.rs:93:5 failures: sys::test_wait::test_waitstatus_from_raw test result: FAILED. 72 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.06s error: test failed, to rerun pass '--test test' ``` Co-authored-by: Al Hoang <[email protected]>
2 parents 69738c0 + d02e274 commit 1647189

30 files changed

+424
-124
lines changed

.cirrus.yml

+3
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ task:
298298
- name: Linux armv7 uclibceabihf
299299
env:
300300
TARGET: armv7-unknown-linux-uclibceabihf
301+
- name: Haiku x86_64
302+
env:
303+
TARGET: x86_64-unknown-haiku
301304
setup_script:
302305
- rustup component add rust-src
303306
<< : *BUILD

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1212
- impl From<SockaddrIn> for std::net::SocketAddrV4 and
1313
impl From<SockaddrIn6> for std::net::SocketAddrV6.
1414
(#[1711](https://github.com/nix-rust/nix/pull/1711))
15+
- Fixed compilation and updated support on Haiku
16+
- Added support for the `x86_64-unknown-haiku` target.
17+
(#[1703](https://github.com/nix-rust/nix/pull/1703))
1518

1619
### Changed
1720

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Tier 3:
8282
* armv7-unknown-linux-uclibceabihf
8383
* x86_64-fuchsia
8484
* x86_64-unknown-dragonfly
85+
* x86_64-unknown-haiku
8586
* x86_64-unknown-linux-gnux32
8687
* x86_64-unknown-openbsd
8788
* x86_64-unknown-redox

bors.toml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ status = [
3636
"iOS aarch64",
3737
"iOS x86_64",
3838
"Illumos",
39+
"Haiku x86_64",
3940
]
4041

4142
# Set bors's timeout to 1 hour

src/dir.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl Entry {
226226
/// notably, some Linux filesystems don't implement this. The caller should use `stat` or
227227
/// `fstat` if this returns `None`.
228228
pub fn file_type(&self) -> Option<Type> {
229-
#[cfg(not(any(target_os = "illumos", target_os = "solaris")))]
229+
#[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))]
230230
match self.0.d_type {
231231
libc::DT_FIFO => Some(Type::Fifo),
232232
libc::DT_CHR => Some(Type::CharacterDevice),
@@ -238,8 +238,8 @@ impl Entry {
238238
/* libc::DT_UNKNOWN | */ _ => None,
239239
}
240240

241-
// illumos and Solaris systems do not have the d_type member at all:
242-
#[cfg(any(target_os = "illumos", target_os = "solaris"))]
241+
// illumos, Solaris, and Haiku systems do not have the d_type member at all:
242+
#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))]
243243
None
244244
}
245245
}

src/errno.rs

+198-11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ cfg_if! {
3030
unsafe fn errno_location() -> *mut c_int {
3131
libc::___errno()
3232
}
33+
} else if #[cfg(any(target_os = "haiku",))] {
34+
unsafe fn errno_location() -> *mut c_int {
35+
libc::_errnop()
36+
}
3337
}
3438
}
3539

@@ -201,6 +205,7 @@ fn desc(errno: Errno) -> &'static str {
201205
ENOMEM => "Out of memory",
202206
EACCES => "Permission denied",
203207
EFAULT => "Bad address",
208+
#[cfg(not(target_os = "haiku"))]
204209
ENOTBLK => "Block device required",
205210
EBUSY => "Device or resource busy",
206211
EEXIST => "File exists",
@@ -237,8 +242,11 @@ fn desc(errno: Errno) -> &'static str {
237242
EPROTOTYPE => "Protocol wrong type for socket",
238243
ENOPROTOOPT => "Protocol not available",
239244
EPROTONOSUPPORT => "Protocol not supported",
245+
#[cfg(not(target_os = "haiku"))]
240246
ESOCKTNOSUPPORT => "Socket type not supported",
247+
#[cfg(not(target_os = "haiku"))]
241248
EPFNOSUPPORT => "Protocol family not supported",
249+
#[cfg(not(target_os = "haiku"))]
242250
EAFNOSUPPORT => "Address family not supported by protocol",
243251
EADDRINUSE => "Address already in use",
244252
EADDRNOTAVAIL => "Cannot assign requested address",
@@ -251,6 +259,7 @@ fn desc(errno: Errno) -> &'static str {
251259
EISCONN => "Transport endpoint is already connected",
252260
ENOTCONN => "Transport endpoint is not connected",
253261
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
262+
#[cfg(not(target_os = "haiku"))]
254263
ETOOMANYREFS => "Too many references: cannot splice",
255264
ETIMEDOUT => "Connection timed out",
256265
ECONNREFUSED => "Connection refused",
@@ -409,7 +418,7 @@ fn desc(errno: Errno) -> &'static str {
409418
EBADMSG => "Trying to read unreadable message",
410419

411420
#[cfg(any(target_os = "linux", target_os = "android",
412-
target_os = "fuchsia"))]
421+
target_os = "fuchsia", target_os = "haiku"))]
413422
EOVERFLOW => "Value too large for defined data type",
414423

415424
#[cfg(any(target_os = "linux", target_os = "android",
@@ -516,7 +525,7 @@ fn desc(errno: Errno) -> &'static str {
516525

517526
#[cfg(any(target_os = "linux", target_os = "android",
518527
target_os = "illumos", target_os = "solaris",
519-
target_os = "fuchsia"))]
528+
target_os = "fuchsia", target_os = "haiku"))]
520529
ECANCELED => "Operation canceled",
521530

522531
#[cfg(any(target_os = "linux", target_os = "android",
@@ -587,24 +596,26 @@ fn desc(errno: Errno) -> &'static str {
587596

588597
#[cfg(any(target_os = "macos", target_os = "freebsd",
589598
target_os = "dragonfly", target_os = "ios",
590-
target_os = "netbsd", target_os = "redox"))]
599+
target_os = "netbsd", target_os = "redox",
600+
target_os = "haiku"))]
591601
EILSEQ => "Illegal byte sequence",
592602

593603
#[cfg(any(target_os = "macos", target_os = "freebsd",
594604
target_os = "dragonfly", target_os = "ios",
595-
target_os = "openbsd", target_os = "netbsd"))]
605+
target_os = "openbsd", target_os = "netbsd",
606+
target_os = "haiku"))]
596607
ENOATTR => "Attribute not found",
597608

598609
#[cfg(any(target_os = "macos", target_os = "freebsd",
599610
target_os = "dragonfly", target_os = "ios",
600611
target_os = "openbsd", target_os = "netbsd",
601-
target_os = "redox"))]
612+
target_os = "redox", target_os = "haiku"))]
602613
EBADMSG => "Bad message",
603614

604615
#[cfg(any(target_os = "macos", target_os = "freebsd",
605616
target_os = "dragonfly", target_os = "ios",
606617
target_os = "openbsd", target_os = "netbsd",
607-
target_os = "redox"))]
618+
target_os = "redox", target_os = "haiku"))]
608619
EPROTO => "Protocol error",
609620

610621
#[cfg(any(target_os = "macos", target_os = "freebsd",
@@ -620,7 +631,8 @@ fn desc(errno: Errno) -> &'static str {
620631
#[cfg(any(target_os = "macos", target_os = "freebsd",
621632
target_os = "dragonfly", target_os = "ios",
622633
target_os = "openbsd", target_os = "netbsd",
623-
target_os = "illumos", target_os = "solaris"))]
634+
target_os = "illumos", target_os = "solaris",
635+
target_os = "haiku"))]
624636
ENOTSUP => "Operation not supported",
625637

626638
#[cfg(any(target_os = "macos", target_os = "freebsd",
@@ -638,14 +650,14 @@ fn desc(errno: Errno) -> &'static str {
638650
target_os = "dragonfly", target_os = "ios",
639651
target_os = "openbsd", target_os = "netbsd",
640652
target_os = "redox", target_os = "illumos",
641-
target_os = "solaris"))]
653+
target_os = "solaris", target_os = "haiku"))]
642654
EDQUOT => "Disc quota exceeded",
643655

644656
#[cfg(any(target_os = "macos", target_os = "freebsd",
645657
target_os = "dragonfly", target_os = "ios",
646658
target_os = "openbsd", target_os = "netbsd",
647659
target_os = "redox", target_os = "illumos",
648-
target_os = "solaris"))]
660+
target_os = "solaris", target_os = "haiku"))]
649661
ESTALE => "Stale NFS file handle",
650662

651663
#[cfg(any(target_os = "macos", target_os = "freebsd",
@@ -714,15 +726,15 @@ fn desc(errno: Errno) -> &'static str {
714726
EBADMACHO => "Malformed Macho file",
715727

716728
#[cfg(any(target_os = "macos", target_os = "ios",
717-
target_os = "netbsd"))]
729+
target_os = "netbsd", target_os = "haiku"))]
718730
EMULTIHOP => "Reserved",
719731

720732
#[cfg(any(target_os = "macos", target_os = "ios",
721733
target_os = "netbsd", target_os = "redox"))]
722734
ENODATA => "No message available on STREAM",
723735

724736
#[cfg(any(target_os = "macos", target_os = "ios",
725-
target_os = "netbsd"))]
737+
target_os = "netbsd", target_os = "haiku"))]
726738
ENOLINK => "Reserved",
727739

728740
#[cfg(any(target_os = "macos", target_os = "ios",
@@ -2725,3 +2737,178 @@ mod consts {
27252737
}
27262738
}
27272739
}
2740+
2741+
#[cfg(target_os = "haiku")]
2742+
mod consts {
2743+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
2744+
#[repr(i32)]
2745+
#[non_exhaustive]
2746+
pub enum Errno {
2747+
UnknownErrno = 0,
2748+
EPERM = libc::EPERM,
2749+
ENOENT = libc::ENOENT,
2750+
ESRCH = libc::ESRCH,
2751+
EINTR = libc::EINTR,
2752+
EIO = libc::EIO,
2753+
ENXIO = libc::ENXIO,
2754+
E2BIG = libc::E2BIG,
2755+
ENOEXEC = libc::ENOEXEC,
2756+
EBADF = libc::EBADF,
2757+
ECHILD = libc::ECHILD,
2758+
EDEADLK = libc::EDEADLK,
2759+
ENOMEM = libc::ENOMEM,
2760+
EACCES = libc::EACCES,
2761+
EFAULT = libc::EFAULT,
2762+
EBUSY = libc::EBUSY,
2763+
EEXIST = libc::EEXIST,
2764+
EXDEV = libc::EXDEV,
2765+
ENODEV = libc::ENODEV,
2766+
ENOTDIR = libc::ENOTDIR,
2767+
EISDIR = libc::EISDIR,
2768+
EINVAL = libc::EINVAL,
2769+
ENFILE = libc::ENFILE,
2770+
EMFILE = libc::EMFILE,
2771+
ENOTTY = libc::ENOTTY,
2772+
ETXTBSY = libc::ETXTBSY,
2773+
EFBIG = libc::EFBIG,
2774+
ENOSPC = libc::ENOSPC,
2775+
ESPIPE = libc::ESPIPE,
2776+
EROFS = libc::EROFS,
2777+
EMLINK = libc::EMLINK,
2778+
EPIPE = libc::EPIPE,
2779+
EDOM = libc::EDOM,
2780+
ERANGE = libc::ERANGE,
2781+
EAGAIN = libc::EAGAIN,
2782+
EINPROGRESS = libc::EINPROGRESS,
2783+
EALREADY = libc::EALREADY,
2784+
ENOTSOCK = libc::ENOTSOCK,
2785+
EDESTADDRREQ = libc::EDESTADDRREQ,
2786+
EMSGSIZE = libc::EMSGSIZE,
2787+
EPROTOTYPE = libc::EPROTOTYPE,
2788+
ENOPROTOOPT = libc::ENOPROTOOPT,
2789+
EPROTONOSUPPORT = libc::EPROTONOSUPPORT,
2790+
ENOTSUP = libc::ENOTSUP,
2791+
EADDRINUSE = libc::EADDRINUSE,
2792+
EADDRNOTAVAIL = libc::EADDRNOTAVAIL,
2793+
ENETDOWN = libc::ENETDOWN,
2794+
ENETUNREACH = libc::ENETUNREACH,
2795+
ENETRESET = libc::ENETRESET,
2796+
ECONNABORTED = libc::ECONNABORTED,
2797+
ECONNRESET = libc::ECONNRESET,
2798+
ENOBUFS = libc::ENOBUFS,
2799+
EISCONN = libc::EISCONN,
2800+
ENOTCONN = libc::ENOTCONN,
2801+
ESHUTDOWN = libc::ESHUTDOWN,
2802+
ETIMEDOUT = libc::ETIMEDOUT,
2803+
ECONNREFUSED = libc::ECONNREFUSED,
2804+
ELOOP = libc::ELOOP,
2805+
ENAMETOOLONG = libc::ENAMETOOLONG,
2806+
EHOSTDOWN = libc::EHOSTDOWN,
2807+
EHOSTUNREACH = libc::EHOSTUNREACH,
2808+
ENOTEMPTY = libc::ENOTEMPTY,
2809+
EDQUOT = libc::EDQUOT,
2810+
ESTALE = libc::ESTALE,
2811+
ENOLCK = libc::ENOLCK,
2812+
ENOSYS = libc::ENOSYS,
2813+
EIDRM = libc::EIDRM,
2814+
ENOMSG = libc::ENOMSG,
2815+
EOVERFLOW = libc::EOVERFLOW,
2816+
ECANCELED = libc::ECANCELED,
2817+
EILSEQ = libc::EILSEQ,
2818+
ENOATTR = libc::ENOATTR,
2819+
EBADMSG = libc::EBADMSG,
2820+
EMULTIHOP = libc::EMULTIHOP,
2821+
ENOLINK = libc::ENOLINK,
2822+
EPROTO = libc::EPROTO,
2823+
}
2824+
2825+
impl Errno {
2826+
pub const EWOULDBLOCK: Errno = Errno::EAGAIN;
2827+
pub const EDEADLOCK: Errno = Errno::EDEADLK;
2828+
pub const EOPNOTSUPP: Errno = Errno::ENOTSUP;
2829+
}
2830+
2831+
pub const fn from_i32(e: i32) -> Errno {
2832+
use self::Errno::*;
2833+
2834+
match e {
2835+
libc::EPERM => EPERM,
2836+
libc::ENOENT => ENOENT,
2837+
libc::ESRCH => ESRCH,
2838+
libc::EINTR => EINTR,
2839+
libc::EIO => EIO,
2840+
libc::ENXIO => ENXIO,
2841+
libc::E2BIG => E2BIG,
2842+
libc::ENOEXEC => ENOEXEC,
2843+
libc::EBADF => EBADF,
2844+
libc::ECHILD => ECHILD,
2845+
libc::EDEADLK => EDEADLK,
2846+
libc::ENOMEM => ENOMEM,
2847+
libc::EACCES => EACCES,
2848+
libc::EFAULT => EFAULT,
2849+
libc::EBUSY => EBUSY,
2850+
libc::EEXIST => EEXIST,
2851+
libc::EXDEV => EXDEV,
2852+
libc::ENODEV => ENODEV,
2853+
libc::ENOTDIR => ENOTDIR,
2854+
libc::EISDIR => EISDIR,
2855+
libc::EINVAL => EINVAL,
2856+
libc::ENFILE => ENFILE,
2857+
libc::EMFILE => EMFILE,
2858+
libc::ENOTTY => ENOTTY,
2859+
libc::ETXTBSY => ETXTBSY,
2860+
libc::EFBIG => EFBIG,
2861+
libc::ENOSPC => ENOSPC,
2862+
libc::ESPIPE => ESPIPE,
2863+
libc::EROFS => EROFS,
2864+
libc::EMLINK => EMLINK,
2865+
libc::EPIPE => EPIPE,
2866+
libc::EDOM => EDOM,
2867+
libc::ERANGE => ERANGE,
2868+
libc::EAGAIN => EAGAIN,
2869+
libc::EINPROGRESS => EINPROGRESS,
2870+
libc::EALREADY => EALREADY,
2871+
libc::ENOTSOCK => ENOTSOCK,
2872+
libc::EDESTADDRREQ => EDESTADDRREQ,
2873+
libc::EMSGSIZE => EMSGSIZE,
2874+
libc::EPROTOTYPE => EPROTOTYPE,
2875+
libc::ENOPROTOOPT => ENOPROTOOPT,
2876+
libc::EPROTONOSUPPORT => EPROTONOSUPPORT,
2877+
libc::ENOTSUP => ENOTSUP,
2878+
libc::EADDRINUSE => EADDRINUSE,
2879+
libc::EADDRNOTAVAIL => EADDRNOTAVAIL,
2880+
libc::ENETDOWN => ENETDOWN,
2881+
libc::ENETUNREACH => ENETUNREACH,
2882+
libc::ENETRESET => ENETRESET,
2883+
libc::ECONNABORTED => ECONNABORTED,
2884+
libc::ECONNRESET => ECONNRESET,
2885+
libc::ENOBUFS => ENOBUFS,
2886+
libc::EISCONN => EISCONN,
2887+
libc::ENOTCONN => ENOTCONN,
2888+
libc::ESHUTDOWN => ESHUTDOWN,
2889+
libc::ETIMEDOUT => ETIMEDOUT,
2890+
libc::ECONNREFUSED => ECONNREFUSED,
2891+
libc::ELOOP => ELOOP,
2892+
libc::ENAMETOOLONG => ENAMETOOLONG,
2893+
libc::EHOSTDOWN => EHOSTDOWN,
2894+
libc::EHOSTUNREACH => EHOSTUNREACH,
2895+
libc::ENOTEMPTY => ENOTEMPTY,
2896+
libc::EDQUOT => EDQUOT,
2897+
libc::ESTALE => ESTALE,
2898+
libc::ENOLCK => ENOLCK,
2899+
libc::ENOSYS => ENOSYS,
2900+
libc::EIDRM => EIDRM,
2901+
libc::ENOMSG => ENOMSG,
2902+
libc::EOVERFLOW => EOVERFLOW,
2903+
libc::ECANCELED => ECANCELED,
2904+
libc::EILSEQ => EILSEQ,
2905+
libc::ENOATTR => ENOATTR,
2906+
libc::EBADMSG => EBADMSG,
2907+
libc::EMULTIHOP => EMULTIHOP,
2908+
libc::ENOLINK => ENOLINK,
2909+
libc::EPROTO => EPROTO,
2910+
_ => UnknownErrno,
2911+
}
2912+
}
2913+
}
2914+

src/fcntl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ libc_bitflags!(
5858
/// Open the file in append-only mode.
5959
O_APPEND;
6060
/// Generate a signal when input or output becomes possible.
61-
#[cfg(not(any(target_os = "illumos", target_os = "solaris")))]
61+
#[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))]
6262
#[cfg_attr(docsrs, doc(cfg(all())))]
6363
O_ASYNC;
6464
/// Closes the file descriptor once an `execve` call is made.
@@ -128,7 +128,7 @@ libc_bitflags!(
128128
#[cfg_attr(docsrs, doc(cfg(all())))]
129129
O_NOCTTY;
130130
/// Same as `O_NONBLOCK`.
131-
#[cfg(not(target_os = "redox"))]
131+
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
132132
#[cfg_attr(docsrs, doc(cfg(all())))]
133133
O_NDELAY;
134134
/// `open()` will fail if the given path is a symbolic link.

src/features.rs

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ mod os {
114114
#[cfg(any(target_os = "macos",
115115
target_os = "ios",
116116
target_os = "fuchsia",
117+
target_os = "haiku",
117118
target_os = "solaris"))]
118119
mod os {
119120
/// Check if the OS supports atomic close-on-exec for sockets

0 commit comments

Comments
 (0)