diff options
-rwxr-xr-x | libc-test/build.rs | 5 | ||||
-rw-r--r-- | libc-test/semver/dragonfly.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/netbsd.txt | 8 | ||||
-rw-r--r-- | libc-test/semver/openbsd.txt | 5 | ||||
-rw-r--r-- | libc-test/semver/unix.txt | 1 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/dragonfly/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 15 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/mod.rs | 17 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/mod.rs | 7 | ||||
-rw-r--r-- | src/unix/bsd/netbsdlike/netbsd/mod.rs | 10 | ||||
-rw-r--r-- | src/unix/haiku/native.rs | 37 | ||||
-rw-r--r-- | src/unix/mod.rs | 1 | ||||
-rw-r--r-- | src/unix/redox/mod.rs | 129 |
13 files changed, 167 insertions, 84 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index e91a55fece..47eeaac524 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -422,6 +422,7 @@ fn test_openbsd(target: &str) { "sys/ioctl.h", "sys/mman.h", "sys/resource.h", + "sys/shm.h", "sys/socket.h", "sys/time.h", "sys/un.h", @@ -960,6 +961,7 @@ fn test_netbsd(target: &str) { "sys/mount.h", "sys/ptrace.h", "sys/resource.h", + "sys/shm.h", "sys/socket.h", "sys/statvfs.h", "sys/sysctl.h", @@ -1167,12 +1169,14 @@ fn test_dragonflybsd(target: &str) { "sys/event.h", "sys/file.h", "sys/ioctl.h", + "sys/ipc.h", "sys/mman.h", "sys/mount.h", "sys/ptrace.h", "sys/resource.h", "sys/rtprio.h", "sys/sched.h", + "sys/shm.h", "sys/socket.h", "sys/stat.h", "sys/statvfs.h", @@ -3282,6 +3286,7 @@ fn test_haiku(target: &str) { "kernel/fs_volume.h", "kernel/image.h", "kernel/scheduler.h", + "storage/FindDirectory.h", "storage/StorageDefs.h", "support/Errors.h", "support/SupportDefs.h", diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 1cefa749c1..e51c81f922 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -341,6 +341,16 @@ IFF_STATICARP IFF_UP INIT_PROCESS IOV_MAX +IPC_CREAT +IPC_EXCL +IPC_M +IPC_NOWAIT +IPC_PRIVATE +IPC_R +IPC_RMID +IPC_SET +IPC_STAT +IPC_W IPPROTO_3PC IPPROTO_ADFS IPPROTO_AH @@ -827,6 +837,10 @@ SF_NOHISTORY SF_NOUNLINK SF_SETTABLE SF_XLINK +SHM_R +SHM_RDONLY +SHM_RND +SHM_W SIGEMT SIGEV_KEVENT SIGEV_NONE diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index d4d83a1d5b..db4c080e87 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -351,11 +351,14 @@ INIT_PROCESS IOV_MAX IPC_CREAT IPC_EXCL +IPC_M IPC_NOWAIT IPC_PRIVATE +IPC_R IPC_RMID IPC_SET IPC_STAT +IPC_W IPPROTO_AH IPPROTO_CARP IPPROTO_DCCP @@ -800,6 +803,8 @@ SF_LOG SF_SETTABLE SF_SNAPINVAL SF_SNAPSHOT +SHM_R +SHM_W SIGEMT SIGEV_NONE SIGEV_SIGNAL @@ -1169,8 +1174,11 @@ lio_listio localeconv_l lockf login +loginx logout +logoutx logwtmp +logwtmpx login_tty lutimes lwpid_t diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 240192d92a..9b2a9be272 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -242,11 +242,14 @@ IFF_UP IOV_MAX IPC_CREAT IPC_EXCL +IPC_M IPC_NOWAIT IPC_PRIVATE +IPC_R IPC_RMID IPC_SET IPC_STAT +IPC_W IPPROTO_AH IPPROTO_CARP IPPROTO_DIVERT @@ -670,6 +673,8 @@ SF_APPEND SF_ARCHIVED SF_IMMUTABLE SF_SETTABLE +SHM_R +SHM_W SIGEMT SIGINFO SIGSTKSZ diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt index d540c29cc2..7fd544874b 100644 --- a/libc-test/semver/unix.txt +++ b/libc-test/semver/unix.txt @@ -594,6 +594,7 @@ gmtime_r grantpt group hostent +hstrerror if_indextoname if_nametoindex in6_addr diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 02e7a8af06..7a620f3886 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -189,7 +189,7 @@ s! { } pub struct stack_t { - pub ss_sp: *mut ::c_char, + pub ss_sp: *mut ::c_void, pub ss_size: ::size_t, pub ss_flags: ::c_int, } diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 338d986c50..23a5e62603 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -10,7 +10,6 @@ pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type idtype_t = ::c_uint; -pub type key_t = ::c_long; pub type msglen_t = ::c_ulong; pub type msgqnum_t = ::c_ulong; @@ -1176,22 +1175,8 @@ pub const NET_RT_IFMALIST: ::c_int = 4; pub const NET_RT_IFLISTL: ::c_int = 5; // System V IPC -pub const IPC_PRIVATE: ::key_t = 0; -pub const IPC_CREAT: ::c_int = 0o1000; -pub const IPC_EXCL: ::c_int = 0o2000; -pub const IPC_NOWAIT: ::c_int = 0o4000; -pub const IPC_RMID: ::c_int = 0; -pub const IPC_SET: ::c_int = 1; -pub const IPC_STAT: ::c_int = 2; pub const IPC_INFO: ::c_int = 3; -pub const IPC_R: ::c_int = 0o400; -pub const IPC_W: ::c_int = 0o200; -pub const IPC_M: ::c_int = 0o10000; pub const MSG_NOERROR: ::c_int = 0o10000; -pub const SHM_RDONLY: ::c_int = 0o10000; -pub const SHM_RND: ::c_int = 0o20000; -pub const SHM_R: ::c_int = 0o400; -pub const SHM_W: ::c_int = 0o200; pub const SHM_LOCK: ::c_int = 11; pub const SHM_UNLOCK: ::c_int = 12; pub const SHM_STAT: ::c_int = 13; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 59ebf8f2bc..bed49c907e 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -13,6 +13,7 @@ pub type speed_t = ::c_uint; pub type nl_item = ::c_int; pub type id_t = i64; pub type vm_size_t = ::uintptr_t; +pub type key_t = ::c_long; // elf.h @@ -1358,6 +1359,22 @@ pub const TIME_ERROR: ::c_int = 5; pub const REG_ENOSYS: ::c_int = -1; pub const REG_ILLSEQ: ::c_int = 17; +pub const IPC_PRIVATE: ::key_t = 0; +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_R: ::c_int = 0o400; +pub const IPC_W: ::c_int = 0o200; +pub const IPC_M: ::c_int = 0o10000; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + safe_f! { pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { status == 0x13 diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index e7e376309b..6da25ca34a 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -238,6 +238,13 @@ pub const IPC_RMID: ::c_int = 0; pub const IPC_SET: ::c_int = 1; pub const IPC_STAT: ::c_int = 2; +pub const IPC_R: ::c_int = 0o000400; +pub const IPC_W: ::c_int = 0o000200; +pub const IPC_M: ::c_int = 0o010000; + +pub const SHM_R: ::c_int = IPC_R; +pub const SHM_W: ::c_int = IPC_W; + pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 540acb3b34..795eb36ab3 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2333,8 +2333,18 @@ extern "C" { ) -> *mut ::c_char; #[link_name = "__login50"] pub fn login(ut: *const utmp); + #[link_name = "__loginx50"] + pub fn loginx(ut: *const utmpx); pub fn logout(line: *const ::c_char); + pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int); pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char); + pub fn logwtmpx( + line: *const ::c_char, + name: *const ::c_char, + host: *const ::c_char, + status: ::c_int, + tpe: ::c_int, + ); pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry; } diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs index 5a37c68241..f432f90fbb 100644 --- a/src/unix/haiku/native.rs +++ b/src/unix/haiku/native.rs @@ -67,6 +67,36 @@ e! { SCHEDULER_MODE_LOW_LATENCY, SCHEDULER_MODE_POWER_SAVING, } + + // FindDirectory.h + pub enum path_base_directory { + B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY, + B_FIND_PATH_ADD_ONS_DIRECTORY, + B_FIND_PATH_APPS_DIRECTORY, + B_FIND_PATH_BIN_DIRECTORY, + B_FIND_PATH_BOOT_DIRECTORY, + B_FIND_PATH_CACHE_DIRECTORY, + B_FIND_PATH_DATA_DIRECTORY, + B_FIND_PATH_DEVELOP_DIRECTORY, + B_FIND_PATH_DEVELOP_LIB_DIRECTORY, + B_FIND_PATH_DOCUMENTATION_DIRECTORY, + B_FIND_PATH_ETC_DIRECTORY, + B_FIND_PATH_FONTS_DIRECTORY, + B_FIND_PATH_HEADERS_DIRECTORY, + B_FIND_PATH_LIB_DIRECTORY, + B_FIND_PATH_LOG_DIRECTORY, + B_FIND_PATH_MEDIA_NODES_DIRECTORY, + B_FIND_PATH_PACKAGES_DIRECTORY, + B_FIND_PATH_PREFERENCES_DIRECTORY, + B_FIND_PATH_SERVERS_DIRECTORY, + B_FIND_PATH_SETTINGS_DIRECTORY, + B_FIND_PATH_SOUNDS_DIRECTORY, + B_FIND_PATH_SPOOL_DIRECTORY, + B_FIND_PATH_TRANSLATORS_DIRECTORY, + B_FIND_PATH_VAR_DIRECTORY, + B_FIND_PATH_IMAGE_PATH = 1000, + B_FIND_PATH_PACKAGE_PATH, + } } s! { @@ -934,6 +964,13 @@ extern "C" { info: *mut image_info, size: ::size_t, ) -> status_t; + pub fn find_path( + codePointer: *const ::c_void, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + pathBuffer: *mut ::c_char, + bufferSize: usize, + ) -> status_t; } // The following functions are defined as macros in C/C++ diff --git a/src/unix/mod.rs b/src/unix/mod.rs index f91ae61670..21f903b659 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -1171,6 +1171,7 @@ extern "C" { )))] #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")] pub fn freeaddrinfo(res: *mut addrinfo); + pub fn hstrerror(errcode: ::c_int) -> *const ::c_char; pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; #[cfg_attr( any( diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 05c7fad454..747d98cc8f 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -692,25 +692,24 @@ pub const SOCK_SEQPACKET: ::c_int = 5; pub const SOL_SOCKET: ::c_int = 1; // sys/termios.h -pub const NCCS: usize = 32; - -pub const VINTR: usize = 0; -pub const VQUIT: usize = 1; -pub const VERASE: usize = 2; -pub const VKILL: usize = 3; -pub const VEOF: usize = 4; -pub const VTIME: usize = 5; -pub const VMIN: usize = 6; +pub const VEOF: usize = 0; +pub const VEOL: usize = 1; +pub const VEOL2: usize = 2; +pub const VERASE: usize = 3; +pub const VWERASE: usize = 4; +pub const VKILL: usize = 5; +pub const VREPRINT: usize = 6; pub const VSWTC: usize = 7; -pub const VSTART: usize = 8; -pub const VSTOP: usize = 9; +pub const VINTR: usize = 8; +pub const VQUIT: usize = 9; pub const VSUSP: usize = 10; -pub const VEOL: usize = 11; -pub const VREPRINT: usize = 12; -pub const VDISCARD: usize = 13; -pub const VWERASE: usize = 14; -pub const VLNEXT: usize = 15; -pub const VEOL2: usize = 16; +pub const VSTART: usize = 12; +pub const VSTOP: usize = 13; +pub const VLNEXT: usize = 14; +pub const VDISCARD: usize = 15; +pub const VMIN: usize = 16; +pub const VTIME: usize = 17; +pub const NCCS: usize = 32; pub const IGNBRK: ::tcflag_t = 0o000_001; pub const BRKINT: ::tcflag_t = 0o000_002; @@ -721,25 +720,17 @@ pub const ISTRIP: ::tcflag_t = 0o000_040; pub const INLCR: ::tcflag_t = 0o000_100; pub const IGNCR: ::tcflag_t = 0o000_200; pub const ICRNL: ::tcflag_t = 0o000_400; -pub const IUCLC: ::tcflag_t = 0o001_000; -pub const IXON: ::tcflag_t = 0o002_000; -pub const IXANY: ::tcflag_t = 0o004_000; -pub const IXOFF: ::tcflag_t = 0o010_000; -pub const IMAXBEL: ::tcflag_t = 0o020_000; -pub const IUTF8: ::tcflag_t = 0o040_000; +pub const IXON: ::tcflag_t = 0o001_000; +pub const IXOFF: ::tcflag_t = 0o002_000; pub const OPOST: ::tcflag_t = 0o000_001; -pub const OLCUC: ::tcflag_t = 0o000_002; -pub const ONLCR: ::tcflag_t = 0o000_004; +pub const ONLCR: ::tcflag_t = 0o000_002; +pub const OLCUC: ::tcflag_t = 0o000_004; pub const OCRNL: ::tcflag_t = 0o000_010; pub const ONOCR: ::tcflag_t = 0o000_020; -pub const ONLRET: ::tcflag_t = 0o00_0040; -pub const OFILL: ::tcflag_t = 0o000_100; -pub const OFDEL: ::tcflag_t = 0o000_200; - -pub const VTDLY: usize = 0o040_000; -pub const VT0: usize = 0o000_000; -pub const VT1: usize = 0o040_000; +pub const ONLRET: ::tcflag_t = 0o000_040; +pub const OFILL: ::tcflag_t = 0o0000_100; +pub const OFDEL: ::tcflag_t = 0o0000_200; pub const B0: speed_t = 0o000_000; pub const B50: speed_t = 0o000_001; @@ -758,43 +749,45 @@ pub const B9600: speed_t = 0o000_015; pub const B19200: speed_t = 0o000_016; pub const B38400: speed_t = 0o000_017; -pub const B57600: speed_t = 0o010_001; -pub const B115200: speed_t = 0o010_002; -pub const B230400: speed_t = 0o010_003; -pub const B460800: speed_t = 0o010_004; -pub const B500000: speed_t = 0o010_005; -pub const B576000: speed_t = 0o010_006; -pub const B921600: speed_t = 0o010_007; -pub const B1000000: speed_t = 0o010_010; -pub const B1152000: speed_t = 0o010_011; -pub const B1500000: speed_t = 0o010_012; -pub const B2000000: speed_t = 0o010_013; -pub const B2500000: speed_t = 0o010_014; -pub const B3000000: speed_t = 0o010_015; -pub const B3500000: speed_t = 0o010_016; -pub const B4000000: speed_t = 0o010_017; - -pub const CSIZE: ::tcflag_t = 0o000_060; +pub const B57600: speed_t = 0o0_020; +pub const B115200: speed_t = 0o0_021; +pub const B230400: speed_t = 0o0_022; +pub const B460800: speed_t = 0o0_023; +pub const B500000: speed_t = 0o0_024; +pub const B576000: speed_t = 0o0_025; +pub const B921600: speed_t = 0o0_026; +pub const B1000000: speed_t = 0o0_027; +pub const B1152000: speed_t = 0o0_030; +pub const B1500000: speed_t = 0o0_031; +pub const B2000000: speed_t = 0o0_032; +pub const B2500000: speed_t = 0o0_033; +pub const B3000000: speed_t = 0o0_034; +pub const B3500000: speed_t = 0o0_035; +pub const B4000000: speed_t = 0o0_036; + +pub const CSIZE: ::tcflag_t = 0o001_400; pub const CS5: ::tcflag_t = 0o000_000; -pub const CS6: ::tcflag_t = 0o000_020; -pub const CS7: ::tcflag_t = 0o000_040; -pub const CS8: ::tcflag_t = 0o000_060; -pub const CSTOPB: ::tcflag_t = 0o000_100; -pub const CREAD: ::tcflag_t = 0o000_200; -pub const PARENB: ::tcflag_t = 0o000_400; -pub const PARODD: ::tcflag_t = 0o001_000; -pub const HUPCL: ::tcflag_t = 0o002_000; -pub const CLOCAL: ::tcflag_t = 0o004_000; - -pub const ISIG: ::tcflag_t = 0o000_001; -pub const ICANON: ::tcflag_t = 0o000_002; -pub const ECHO: ::tcflag_t = 0o000_010; -pub const ECHOE: ::tcflag_t = 0o000_020; -pub const ECHOK: ::tcflag_t = 0o000_040; -pub const ECHONL: ::tcflag_t = 0o000_100; -pub const NOFLSH: ::tcflag_t = 0o000_200; -pub const TOSTOP: ::tcflag_t = 0o000_400; -pub const IEXTEN: ::tcflag_t = 0o100_000; +pub const CS6: ::tcflag_t = 0o000_400; +pub const CS7: ::tcflag_t = 0o001_000; +pub const CS8: ::tcflag_t = 0o001_400; + +pub const CSTOPB: ::tcflag_t = 0o002_000; +pub const CREAD: ::tcflag_t = 0o004_000; +pub const PARENB: ::tcflag_t = 0o010_000; +pub const PARODD: ::tcflag_t = 0o020_000; +pub const HUPCL: ::tcflag_t = 0o040_000; + +pub const CLOCAL: ::tcflag_t = 0o0100000; + +pub const ISIG: ::tcflag_t = 0x0000_0080; +pub const ICANON: ::tcflag_t = 0x0000_0100; +pub const ECHO: ::tcflag_t = 0x0000_0008; +pub const ECHOE: ::tcflag_t = 0x0000_0002; +pub const ECHOK: ::tcflag_t = 0x0000_0004; +pub const ECHONL: ::tcflag_t = 0x0000_0010; +pub const NOFLSH: ::tcflag_t = 0x8000_0000; +pub const TOSTOP: ::tcflag_t = 0x0040_0000; +pub const IEXTEN: ::tcflag_t = 0x0000_0400; pub const TCOOFF: ::c_int = 0; pub const TCOON: ::c_int = 1; |