diff options
-rw-r--r--[-rwxr-xr-x] | libc-test/build.rs | 11 | ||||
-rw-r--r-- | libc-test/semver/apple.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/dragonfly.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/freebsd.txt | 27 | ||||
-rw-r--r-- | libc-test/semver/fuchsia.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/linux.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/netbsd.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/openbsd.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/redox.txt | 14 | ||||
-rw-r--r-- | libc-test/semver/unix.txt | 14 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 58 | ||||
-rw-r--r-- | src/unix/haiku/mod.rs | 10 |
12 files changed, 204 insertions, 14 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 59a559afc4..e491cb39d1 100755..100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1790,6 +1790,7 @@ fn test_freebsd(target: &str) { "sys/procctl.h", "sys/procdesc.h", "sys/ptrace.h", + "sys/queue.h", "sys/random.h", "sys/resource.h", "sys/rtprio.h", @@ -1808,6 +1809,7 @@ fn test_freebsd(target: &str) { "sys/user.h", "sys/utsname.h", "sys/wait.h", + "libprocstat.h", "syslog.h", "termios.h", "time.h", @@ -1963,6 +1965,9 @@ fn test_freebsd(target: &str) { // `max_align_t` is not available in FreeBSD 10 "max_align_t" if Some(10) == freebsd_ver => true, + // `procstat` is a private struct + "procstat" => true, + _ => false, } }); @@ -3319,6 +3324,9 @@ fn test_haiku(target: &str) { // is sized as the _POSIX_MAX_PATH, so that path names will fit in // newly allocated dirent objects. This breaks the automated tests. "dirent" => true, + // The following structs contain function pointers, which cannot be initialized + // with mem::zeroed(), so skip the automated test + "image_info" | "thread_info" => true, _ => false, } @@ -3352,6 +3360,9 @@ fn test_haiku(target: &str) { "mlock" | "munlock" => true, // returns const char * on Haiku "strsignal" => true, + // uses an enum as a parameter argument, which is incorrectly + // translated into a struct argument + "find_path" => true, _ => false, } diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 7e1b245feb..d2cf8966f1 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -224,6 +224,7 @@ ENOLINK ENOPOLICY ENOSR ENOSTR +ENOTBLK ENOTRECOVERABLE ENOTSUP EOF @@ -238,9 +239,13 @@ ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT +EREMOTE ERPCMISMATCH ESHLIBVERS +ESOCKTNOSUPPORT ETIME +ETOOMANYREFS +EUSERS EVFILT_AIO EVFILT_FS EVFILT_MACHPORT @@ -365,6 +370,7 @@ IFF_PROMISC IFF_RUNNING IFF_SIMPLEX IFF_UP +IMAXBEL INIT_PROCESS IOV_MAX IPC_CREAT @@ -868,6 +874,7 @@ OFILL OLD_TIME ONOEOT OXTABS +O_ASYNC O_DSYNC O_EXLOCK O_FSYNC @@ -1123,6 +1130,7 @@ SIGEV_NONE SIGEV_SIGNAL SIGEV_THREAD SIGINFO +SIGIO SIGNATURE SIGSTKSZ SIOCGIFADDR @@ -1329,7 +1337,9 @@ UTIME_NOW UTIME_OMIT UTUN_OPT_FLAGS UTUN_OPT_IFNAME +VDISCARD VDSUSP +VLNEXT VM_FLAGS_ALIAS_MASK VM_FLAGS_ANYWHERE VM_FLAGS_FIXED @@ -1425,10 +1435,12 @@ VM_PROT_NONE VM_PROT_READ VM_PROT_WRITE VM_SWAPUSAGE +VREPRINT VSTATUS VT0 VT1 VTDLY +VWERASE WEXITED WNOWAIT WSTOPPED @@ -1490,6 +1502,7 @@ _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -1507,6 +1520,7 @@ _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS +_SC_RE_DUP_MAX _SC_REGEXP _SC_RTSIG_MAX _SC_SAVED_IDS diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 9d1e52b643..ccfc227744 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -219,6 +219,7 @@ ENEEDAUTH ENOATTR ENOLINK ENOMEDIUM +ENOTBLK ENOTSUP EOF EPROCLIM @@ -229,7 +230,11 @@ ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT +EREMOTE ERPCMISMATCH +ESOCKTNOSUPPORT +ETOOMANYREFS +EUSERS EVFILT_AIO EVFILT_EXCEPT EVFILT_FS @@ -339,6 +344,7 @@ IFF_SIMPLEX IFF_SMART IFF_STATICARP IFF_UP +IMAXBEL INIT_PROCESS IOV_MAX IPC_CREAT @@ -669,6 +675,7 @@ NTP_API OLD_TIME ONOEOT OXTABS +O_ASYNC O_DIRECT O_EXLOCK O_FSYNC @@ -852,6 +859,7 @@ SIGEV_NONE SIGEV_SIGNAL SIGEV_THREAD SIGINFO +SIGIO SIGNATURE SIGSTKSZ SIOCGIFADDR @@ -1013,9 +1021,13 @@ UTX_DB_LASTLOG UTX_DB_UTMPX UTX_DB_WTMPX VCHECKPT +VDISCARD VDSUSP VERASE2 +VLNEXT +VREPRINT VSTATUS +VWERASE WEXITED WNOWAIT WSTOPPED @@ -1085,6 +1097,7 @@ _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -1100,6 +1113,7 @@ _SC_PRIORITIZED_IO _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS +_SC_RE_DUP_MAX _SC_REALTIME_SIGNALS _SC_REGEXP _SC_RTSIG_MAX diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 497687a0e4..b4279cd9a6 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -222,6 +222,7 @@ EMULTIHOP ENEEDAUTH ENOATTR ENOLINK +ENOTBLK ENOTCAPABLE ENOTRECOVERABLE ENOTSUP @@ -235,7 +236,11 @@ ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT +EREMOTE ERPCMISMATCH +ESOCKTNOSUPPORT +ETOOMANYREFS +EUSERS EVFILT_AIO EVFILT_EMPTY EVFILT_FS @@ -365,6 +370,7 @@ IFF_RUNNING IFF_SIMPLEX IFF_STATICARP IFF_UP +IMAXBEL INIT_PROCESS IOV_MAX IPC_CREAT @@ -752,6 +758,7 @@ NTP_API OLD_TIME ONOEOT OXTABS +O_ASYNC O_DIRECT O_EXEC O_EXLOCK @@ -1019,6 +1026,7 @@ SIGEV_SIGNAL SIGEV_THREAD SIGEV_THREAD_ID SIGINFO +SIGIO SIGSTKSZ SIOCGIFADDR SLIPDISC @@ -1199,9 +1207,13 @@ UTIME_OMIT UTXDB_ACTIVE UTXDB_LASTLOGIN UTXDB_LOG +VDISCARD VDSUSP VERASE2 +VLNEXT VSTATUS +VREPRINT +VWERASE WEXITED WNOWAIT WSTOPPED @@ -1271,6 +1283,7 @@ _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -1288,6 +1301,7 @@ _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS _SC_REGEXP +_SC_RE_DUP_MAX _SC_RTSIG_MAX _SC_SAVED_IDS _SC_SEMAPHORES @@ -1414,6 +1428,8 @@ fflags_t ffs ffsl ffsll +filestat +filestat_list fls flsl flsll @@ -1479,6 +1495,8 @@ kevent key_t killpg kinfo_getvmmap +kinfo_proc +kinfo_vmentry kqueue kld_isloaded kld_load @@ -1575,6 +1593,15 @@ posix_spawnp ppoll preadv procctl +procstat +procstat_close +procstat_freefiles +procstat_freeprocs +procstat_freevmmap +procstat_getfiles +procstat_getprocs +procstat_getvmmap +procstat_open_sysctl pseudo_AF_HDRCMPLT pseudo_AF_KEY pseudo_AF_PIP diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt index 7e9f4f8de5..99fcd6b872 100644 --- a/libc-test/semver/fuchsia.txt +++ b/libc-test/semver/fuchsia.txt @@ -218,6 +218,7 @@ ENONET ENOPKG ENOSR ENOSTR +ENOTBLK ENOTNAM ENOTRECOVERABLE ENOTSUP @@ -248,14 +249,18 @@ ERA_D_FMT ERA_D_T_FMT ERA_T_FMT EREMCHG +EREMOTE EREMOTEIO ERESTART ERFKILL +ESOCKTNOSUPPORT ESRMNT ESTRPIPE ETIME +ETOOMANYREFS EUCLEAN EUNATCH +EUSERS EXFULL EXTA EXTB @@ -334,6 +339,7 @@ IFF_SLAVE IFF_TAP IFF_TUN IFF_UP +IMAXBEL IPC_CREAT IPC_EXCL IPC_INFO @@ -511,6 +517,7 @@ NOSTR OFDEL OFILL OLCUC +O_ASYNC O_DIRECT O_DSYNC O_EXEC @@ -829,6 +836,7 @@ SHM_W SIGEV_NONE SIGEV_SIGNAL SIGEV_THREAD +SIGIO SIGPOLL SIGPWR SIGSTKFLT @@ -976,9 +984,13 @@ T_FMT_AMPM UTIME_NOW UTIME_OMIT VSWTC +VDISCARD +VLNEXT +VREPRINT VT0 VT1 VTDLY +VWERASE WEXITED WNOWAIT WSTOPPED @@ -1042,6 +1054,7 @@ _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -1060,6 +1073,7 @@ _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS +_SC_RE_DUP_MAX _SC_REGEXP _SC_RTSIG_MAX _SC_SAVED_IDS diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index f87184a8fe..d364f576ec 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -376,6 +376,7 @@ ENOLINK ENOMEDIUM ENONET ENOPKG +ENOTBLK ENOSR ENOSTR ENOTNAM @@ -408,9 +409,11 @@ ERA_D_FMT ERA_D_T_FMT ERA_T_FMT EREMCHG +EREMOTE EREMOTEIO ERESTART ERFKILL +ESOCKTNOSUPPORT ESRMNT ESTRPIPE ETH_ALEN @@ -498,9 +501,11 @@ ETH_P_WAN_PPP ETH_P_WCCP ETH_P_X25 ETH_ZLEN +ETOOMANYREFS ETIME EUCLEAN EUNATCH +EUSERS EV_CNT EV_MAX EXFULL @@ -747,6 +752,7 @@ IFLA_VF_PORTS IFLA_WEIGHT IFLA_WIRELESS IFLA_XDP +IMAXBEL INPUT_PROP_CNT INPUT_PROP_MAX IN_ACCESS @@ -1447,6 +1453,7 @@ NUD_STALE OFDEL OFILL OLCUC +O_ASYNC O_DIRECT O_DSYNC O_LARGEFILE @@ -1970,6 +1977,7 @@ SHORT_INODE SIGEV_NONE SIGEV_SIGNAL SIGEV_THREAD +SIGIO SIGPOLL SIGPWR SIGRTMAX @@ -2447,13 +2455,17 @@ UINPUT_VERSION UIO_MAXIOV UTIME_NOW UTIME_OMIT +VDISCARD +VLNEXT VMADDR_CID_ANY VMADDR_CID_HOST VMADDR_CID_HYPERVISOR VMADDR_CID_LOCAL VMADDR_CID_RESERVED VMADDR_PORT_ANY +VREPRINT VSWTC +VWERASE VT0 VT1 VTDLY @@ -2520,6 +2532,7 @@ _SC_GETPW_R_SIZE_MAX _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL +_SC_LOGIN_NAME_MAX _SC_MEMLOCK _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION @@ -2537,6 +2550,7 @@ _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS +_SC_RE_DUP_MAX _SC_REGEXP _SC_RTSIG_MAX _SC_SAVED_IDS diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index 554e6d386f..a2b72aba69 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -271,6 +271,7 @@ ENODATA ENOLINK ENOSR ENOSTR +ENOTBLK ENOTSUP EOF EPROCLIM @@ -281,8 +282,12 @@ ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT +EREMOTE ERPCMISMATCH +ESOCKTNOSUPPORT ETIME +ETOOMANYREFS +EUSERS EVFILT_AIO EVFILT_PROC EVFILT_READ @@ -376,6 +381,7 @@ IFF_PROMISC IFF_RUNNING IFF_SIMPLEX IFF_UP +IMAXBEL INIT_PROCESS IOV_MAX IPC_CREAT @@ -674,6 +680,7 @@ OLD_TIME ONOEOT OXTABS O_ALT_IO +O_ASYNC O_DIRECT O_DSYNC O_EXLOCK @@ -843,6 +850,7 @@ SIGEV_NONE SIGEV_SIGNAL SIGEV_THREAD SIGINFO +SIGIO SIGNATURE SIGSTKSZ SIOCGIFADDR @@ -950,10 +958,14 @@ UTIME_OMIT UT_HOSTSIZE UT_LINESIZE UT_NAMESIZE +VDISCARD VDSUSP +VLNEXT VM_PROC VM_PROC_MAP +VREPRINT VSTATUS +VWERASE WEXITED WNOWAIT WSTOPPED @@ -1004,6 +1016,7 @@ _SC_GETPW_R_SIZE_MAX _SC_IOV_MAX _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -1018,6 +1031,7 @@ _SC_PASS_MAX _SC_PHYS_PAGES _SC_PRIORITY_SCHEDULING _SC_READER_WRITER_LOCKS +_SC_RE_DUP_MAX _SC_REGEXP _SC_SAVED_IDS _SC_SCHED_PRI_MAX diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 06322dc816..2d322e73f2 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -145,6 +145,7 @@ ELAST EMEDIUMTYPE ENEEDAUTH ENOATTR +ENOTBLK ENOMEDIUM ENOTRECOVERABLE ENOTSUP @@ -154,7 +155,11 @@ EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL +EREMOTE ERPCMISMATCH +ESOCKTNOSUPPORT +ETOOMANYREFS +EUSERS EVFILT_AIO EVFILT_PROC EVFILT_READ @@ -239,6 +244,7 @@ IFF_RUNNING IFF_SIMPLEX IFF_STATICARP IFF_UP +IMAXBEL IOV_MAX IPC_CREAT IPC_EXCL @@ -530,6 +536,7 @@ NTFS_MFLAG_CASEINS OLCUC ONOEOT OXTABS +O_ASYNC O_DSYNC O_EXLOCK O_FSYNC @@ -677,6 +684,7 @@ SHM_R SHM_W SIGEMT SIGINFO +SIGIO SIGSTKSZ SIOCGIFADDR SOCK_CLOEXEC @@ -747,8 +755,12 @@ UTIME_OMIT UT_HOSTSIZE UT_LINESIZE UT_NAMESIZE +VDISCARD VDSUSP +VLNEXT +VREPRINT VSTATUS +VWERASE YESEXPR YESSTR _IOFBF @@ -807,6 +819,7 @@ _SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL _SC_LINE_MAX +_SC_LOGIN_NAME_MAX _SC_MAPPED_FILES _SC_MEMLOCK _SC_MEMLOCK_RANGE @@ -823,6 +836,7 @@ _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS _SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS +_SC_RE_DUP_MAX _SC_REGEXP _SC_RTSIG_MAX _SC_SAVED_IDS diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt index 7173b994da..22d72d32bf 100644 --- a/libc-test/semver/redox.txt +++ b/libc-test/semver/redox.txt @@ -55,6 +55,7 @@ ENONET ENOPKG ENOSR ENOSTR +ENOTBLK ENOTNAM ENOTRECOVERABLE ENOTUNIQ @@ -80,14 +81,19 @@ EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD EREMCHG +EREMOTE EREMOTEIO ERESTART +ESOCKTNOSUPPORT ESRMNT ESTRPIPE ETIME +ETOOMANYREFS EUCLEAN EUNATCH +EUSERS EXFULL +IMAXBEL IPV6_ADD_MEMBERSHIP IPV6_DROP_MEMBERSHIP IUCLC @@ -102,6 +108,7 @@ NSIG OFDEL OFILL OLCUC +O_ASYNC O_EXLOCK O_FSYNC O_PATH @@ -109,6 +116,7 @@ O_SHLOCK O_SYMLINK PTHREAD_STACK_MIN SA_RESTORER +SIGIO SIGPWR SIGSTKFLT SOCK_CLOEXEC @@ -130,10 +138,14 @@ TCSETS TIOCGPGRP TIOCSPGRP UTSLENGTH +VDISCARD +VLNEXT +VREPRINT VSWTC VT0 VT1 VTDLY +VWERASE WEXITED WNOWAIT WSTOPPED @@ -149,6 +161,8 @@ _PC_REC_XFER_ALIGN _PC_SOCK_MAXBUF _PC_SYMLINK_MAX _PC_SYNC_IO +_SC_LOGIN_NAME_MAX +_SC_RE_DUP_MAX __WALL __WCLONE __WNOTHREAD diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt index 7fd544874b..300dd26663 100644 --- a/libc-test/semver/unix.txt +++ b/libc-test/semver/unix.txt @@ -97,7 +97,6 @@ ENOMSG ENOPROTOOPT ENOSPC ENOSYS -ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY @@ -113,17 +112,13 @@ EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE -EREMOTE EROFS ESHUTDOWN -ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT -ETOOMANYREFS ETXTBSY -EUSERS EWOULDBLOCK EXDEV EXIT_FAILURE @@ -157,7 +152,6 @@ IF_NAMESIZE IGNBRK IGNCR IGNPAR -IMAXBEL INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK @@ -250,7 +244,6 @@ ONOCR OPOST O_ACCMODE O_APPEND -O_ASYNC O_CLOEXEC O_CREAT O_DIRECTORY @@ -317,7 +310,6 @@ SIGFPE SIGHUP SIGILL SIGINT -SIGIO SIGIOT SIGKILL SIGPIPE @@ -406,22 +398,18 @@ TIOCGWINSZ TIOCSWINSZ TOSTOP USRQUOTA -VDISCARD VEOF VEOL VEOL2 VERASE VINTR VKILL -VLNEXT VMIN VQUIT -VREPRINT VSTART VSTOP VSUSP VTIME -VWERASE WCONTINUED WCOREDUMP WEXITSTATUS @@ -448,12 +436,10 @@ _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_HOST_NAME_MAX -_SC_LOGIN_NAME_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_PAGE_SIZE -_SC_RE_DUP_MAX _SC_STREAM_MAX _SC_SYMLOOP_MAX _SC_TTY_NAME_MAX diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index f75970ed5c..e10a0a777f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -205,6 +205,39 @@ s! { _kve_is_spare: [::c_int; 12], pub kve_path: [[::c_char; 32]; 32], } + + pub struct kinfo_proc { + __pad0: [[::uintptr_t; 17]; 8], + } + + pub struct filestat { + fs_type: ::c_int, + fs_flags: ::c_int, + fs_fflags: ::c_int, + fs_uflags: ::c_int, + fs_fd: ::c_int, + fs_ref_count: ::c_int, + fs_offset: ::off_t, + fs_typedep: *mut ::c_void, + fs_path: *mut ::c_char, + next: *mut filestat, + fs_cap_rights: cap_rights_t, + } + + pub struct filestat_list { + stqh_first: *mut filestat, + stqh_last: *mut *mut filestat, + } + + pub struct procstat { + tpe: ::c_int, + kd: ::uintptr_t, + vmentries: *mut ::c_void, + files: *mut ::c_void, + argv: *mut ::c_void, + envv: *mut ::c_void, + core: ::uintptr_t, + } } s_no_extra_traits! { @@ -1804,6 +1837,31 @@ extern "C" { pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry; } +#[link(name = "procstat")] +extern "C" { + pub fn procstat_open_sysctl() -> *mut procstat; + pub fn procstat_getfiles( + procstat: *mut procstat, + kp: *mut kinfo_proc, + mmapped: ::c_int, + ) -> *mut filestat_list; + pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list); + pub fn procstat_getprocs( + procstat: *mut procstat, + what: ::c_int, + arg: ::c_int, + count: *mut ::c_uint, + ) -> *mut kinfo_proc; + pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc); + pub fn procstat_getvmmap( + procstat: *mut procstat, + kp: *mut kinfo_proc, + count: *mut ::c_uint, + ) -> *mut kinfo_vmentry; + pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry); + pub fn procstat_close(procstat: *mut procstat); +} + cfg_if! { if #[cfg(freebsd13)] { mod freebsd13; diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 611cf2fef5..09c95097c1 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -817,6 +817,15 @@ pub const AF_LOCAL: ::c_int = 9; pub const AF_UNIX: ::c_int = AF_LOCAL; pub const AF_BLUETOOTH: ::c_int = 10; +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_UNIX: ::c_int = AF_UNIX; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; + pub const IP_OPTIONS: ::c_int = 1; pub const IP_HDRINCL: ::c_int = 2; pub const IP_TOS: ::c_int = 3; @@ -987,6 +996,7 @@ pub const _SC_HOST_NAME_MAX: ::c_int = 61; pub const _SC_REGEXP: ::c_int = 62; pub const _SC_SYMLOOP_MAX: ::c_int = 63; pub const _SC_SHELL: ::c_int = 64; +pub const _SC_TTY_NAME_MAX: ::c_int = 65; pub const PTHREAD_STACK_MIN: ::size_t = 8192; |