Skip to content

Commit 2e42c29

Browse files
author
Al Hoang
committed
haiku: merge desc
1 parent 788284c commit 2e42c29

File tree

1 file changed

+19
-86
lines changed

1 file changed

+19
-86
lines changed

src/errno.rs

Lines changed: 19 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ fn last() -> Errno {
187187
Errno::from_i32(errno())
188188
}
189189

190-
#[cfg(not(target_os = "haiku"))]
191190
fn desc(errno: Errno) -> &'static str {
192191
use self::Errno::*;
193192
match errno {
@@ -206,6 +205,7 @@ fn desc(errno: Errno) -> &'static str {
206205
ENOMEM => "Out of memory",
207206
EACCES => "Permission denied",
208207
EFAULT => "Bad address",
208+
#[cfg(not(target_os = "haiku"))]
209209
ENOTBLK => "Block device required",
210210
EBUSY => "Device or resource busy",
211211
EEXIST => "File exists",
@@ -242,8 +242,11 @@ fn desc(errno: Errno) -> &'static str {
242242
EPROTOTYPE => "Protocol wrong type for socket",
243243
ENOPROTOOPT => "Protocol not available",
244244
EPROTONOSUPPORT => "Protocol not supported",
245+
#[cfg(not(target_os = "haiku"))]
245246
ESOCKTNOSUPPORT => "Socket type not supported",
247+
#[cfg(not(target_os = "haiku"))]
246248
EPFNOSUPPORT => "Protocol family not supported",
249+
#[cfg(not(target_os = "haiku"))]
247250
EAFNOSUPPORT => "Address family not supported by protocol",
248251
EADDRINUSE => "Address already in use",
249252
EADDRNOTAVAIL => "Cannot assign requested address",
@@ -256,6 +259,7 @@ fn desc(errno: Errno) -> &'static str {
256259
EISCONN => "Transport endpoint is already connected",
257260
ENOTCONN => "Transport endpoint is not connected",
258261
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
262+
#[cfg(not(target_os = "haiku"))]
259263
ETOOMANYREFS => "Too many references: cannot splice",
260264
ETIMEDOUT => "Connection timed out",
261265
ECONNREFUSED => "Connection refused",
@@ -414,7 +418,7 @@ fn desc(errno: Errno) -> &'static str {
414418
EBADMSG => "Trying to read unreadable message",
415419

416420
#[cfg(any(target_os = "linux", target_os = "android",
417-
target_os = "fuchsia"))]
421+
target_os = "fuchsia", target_os = "haiku"))]
418422
EOVERFLOW => "Value too large for defined data type",
419423

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

522526
#[cfg(any(target_os = "linux", target_os = "android",
523527
target_os = "illumos", target_os = "solaris",
524-
target_os = "fuchsia"))]
528+
target_os = "fuchsia", target_os = "haiku"))]
525529
ECANCELED => "Operation canceled",
526530

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

593597
#[cfg(any(target_os = "macos", target_os = "freebsd",
594598
target_os = "dragonfly", target_os = "ios",
595-
target_os = "netbsd", target_os = "redox"))]
599+
target_os = "netbsd", target_os = "redox",
600+
target_os = "haiku"))]
596601
EILSEQ => "Illegal byte sequence",
597602

598603
#[cfg(any(target_os = "macos", target_os = "freebsd",
599604
target_os = "dragonfly", target_os = "ios",
600-
target_os = "openbsd", target_os = "netbsd"))]
605+
target_os = "openbsd", target_os = "netbsd",
606+
target_os = "haiku"))]
601607
ENOATTR => "Attribute not found",
602608

603609
#[cfg(any(target_os = "macos", target_os = "freebsd",
604610
target_os = "dragonfly", target_os = "ios",
605611
target_os = "openbsd", target_os = "netbsd",
606-
target_os = "redox"))]
612+
target_os = "redox", target_os = "haiku"))]
607613
EBADMSG => "Bad message",
608614

609615
#[cfg(any(target_os = "macos", target_os = "freebsd",
610616
target_os = "dragonfly", target_os = "ios",
611617
target_os = "openbsd", target_os = "netbsd",
612-
target_os = "redox"))]
618+
target_os = "redox", target_os = "haiku"))]
613619
EPROTO => "Protocol error",
614620

615621
#[cfg(any(target_os = "macos", target_os = "freebsd",
@@ -625,7 +631,8 @@ fn desc(errno: Errno) -> &'static str {
625631
#[cfg(any(target_os = "macos", target_os = "freebsd",
626632
target_os = "dragonfly", target_os = "ios",
627633
target_os = "openbsd", target_os = "netbsd",
628-
target_os = "illumos", target_os = "solaris"))]
634+
target_os = "illumos", target_os = "solaris",
635+
target_os = "haiku"))]
629636
ENOTSUP => "Operation not supported",
630637

631638
#[cfg(any(target_os = "macos", target_os = "freebsd",
@@ -643,14 +650,14 @@ fn desc(errno: Errno) -> &'static str {
643650
target_os = "dragonfly", target_os = "ios",
644651
target_os = "openbsd", target_os = "netbsd",
645652
target_os = "redox", target_os = "illumos",
646-
target_os = "solaris"))]
653+
target_os = "solaris", target_os = "haiku"))]
647654
EDQUOT => "Disc quota exceeded",
648655

649656
#[cfg(any(target_os = "macos", target_os = "freebsd",
650657
target_os = "dragonfly", target_os = "ios",
651658
target_os = "openbsd", target_os = "netbsd",
652659
target_os = "redox", target_os = "illumos",
653-
target_os = "solaris"))]
660+
target_os = "solaris", target_os = "haiku"))]
654661
ESTALE => "Stale NFS file handle",
655662

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

721728
#[cfg(any(target_os = "macos", target_os = "ios",
722-
target_os = "netbsd"))]
729+
target_os = "netbsd", target_os = "haiku"))]
723730
EMULTIHOP => "Reserved",
724731

725732
#[cfg(any(target_os = "macos", target_os = "ios",
726733
target_os = "netbsd", target_os = "redox"))]
727734
ENODATA => "No message available on STREAM",
728735

729736
#[cfg(any(target_os = "macos", target_os = "ios",
730-
target_os = "netbsd"))]
737+
target_os = "netbsd", target_os = "haiku"))]
731738
ENOLINK => "Reserved",
732739

733740
#[cfg(any(target_os = "macos", target_os = "ios",
@@ -772,80 +779,6 @@ fn desc(errno: Errno) -> &'static str {
772779
}
773780
}
774781

775-
#[cfg(target_os = "haiku")]
776-
fn desc(errno: Errno) -> &'static str {
777-
use self::Errno::*;
778-
match errno {
779-
UnknownErrno => "Unknown errno",
780-
EPERM => "Operation not permitted",
781-
ENOENT => "No such file or directory",
782-
ESRCH => "No such process",
783-
EINTR => "Interrupted system call",
784-
EIO => "I/O error",
785-
ENXIO => "No such device or address",
786-
E2BIG => "Argument list too long",
787-
ENOEXEC => "Exec format error",
788-
EBADF => "Bad file number",
789-
ECHILD => "No child processes",
790-
EAGAIN => "Try again",
791-
ENOMEM => "Out of memory",
792-
EACCES => "Permission denied",
793-
EFAULT => "Bad address",
794-
EBUSY => "Device or resource busy",
795-
EEXIST => "File exists",
796-
EXDEV => "Cross-device link",
797-
ENODEV => "No such device",
798-
ENOTDIR => "Not a directory",
799-
EISDIR => "Is a directory",
800-
EINVAL => "Invalid argument",
801-
ENFILE => "File table overflow",
802-
EMFILE => "Too many open files",
803-
ENOTTY => "Not a typewriter",
804-
ETXTBSY => "Text file busy",
805-
EFBIG => "File too large",
806-
ENOSPC => "No space left on device",
807-
ESPIPE => "Illegal seek",
808-
EROFS => "Read-only file system",
809-
EMLINK => "Too many links",
810-
EPIPE => "Broken pipe",
811-
EDOM => "Math argument out of domain of func",
812-
ERANGE => "Math result not representable",
813-
EDEADLK => "Resource deadlock would occur",
814-
ENAMETOOLONG => "File name too long",
815-
ENOLCK => "No record locks available",
816-
ENOSYS => "Function not implemented",
817-
ENOTEMPTY => "Directory not empty",
818-
ELOOP => "Too many symbolic links encountered",
819-
ENOMSG => "No message of desired type",
820-
EIDRM => "Identifier removed",
821-
EINPROGRESS => "Operation now in progress",
822-
EALREADY => "Operation already in progress",
823-
ENOTSOCK => "Socket operation on non-socket",
824-
EDESTADDRREQ => "Destination address required",
825-
EMSGSIZE => "Message too long",
826-
EPROTOTYPE => "Protocol wrong type for socket",
827-
ENOPROTOOPT => "Protocol not available",
828-
EPROTONOSUPPORT => "Protocol not supported",
829-
EADDRINUSE => "Address already in use",
830-
EADDRNOTAVAIL => "Cannot assign requested address",
831-
ENETDOWN => "Network is down",
832-
ENETUNREACH => "Network is unreachable",
833-
ENETRESET => "Network dropped connection because of reset",
834-
ECONNABORTED => "Software caused connection abort",
835-
ECONNRESET => "Connection reset by peer",
836-
ENOBUFS => "No buffer space available",
837-
EISCONN => "Transport endpoint is already connected",
838-
ENOTCONN => "Transport endpoint is not connected",
839-
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
840-
ETIMEDOUT => "Connection timed out",
841-
ECONNREFUSED => "Connection refused",
842-
EHOSTDOWN => "Host is down",
843-
EHOSTUNREACH => "No route to host",
844-
_ => "unknown errno",
845-
846-
}
847-
}
848-
849782
#[cfg(any(target_os = "linux", target_os = "android",
850783
target_os = "fuchsia"))]
851784
mod consts {

0 commit comments

Comments
 (0)