summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/unix/bsd/apple/mod.rs1
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/errno.rs1
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs1
-rw-r--r--src/unix/bsd/mod.rs23
-rw-r--r--src/unix/linux_like/linux/musl/b64/aarch64/mod.rs6
-rw-r--r--src/unix/linux_like/mod.rs2
-rw-r--r--src/unix/solarish/mod.rs9
-rw-r--r--src/wasi.rs12
8 files changed, 54 insertions, 1 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 857a2badee..b6984ecd4c 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -1406,6 +1406,7 @@ pub const O_DSYNC: ::c_int = 0x400000;
pub const O_NOCTTY: ::c_int = 0x20000;
pub const O_CLOEXEC: ::c_int = 0x1000000;
pub const O_DIRECTORY: ::c_int = 0x100000;
+pub const O_SYMLINK: ::c_int = 0x200000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
diff --git a/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/src/unix/bsd/freebsdlike/dragonfly/errno.rs
index e9ad63b86b..434ac63a3c 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/errno.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/errno.rs
@@ -1,6 +1,7 @@
// DragonFlyBSD's __error function is declared with "static inline", so it must
// be implemented in the libc crate, as a pointer to a static thread_local.
f! {
+ #[deprecated(since = "0.2.77", "Use `__errno_location()` instead")]
pub fn __error() -> *mut ::c_int {
&mut errno
}
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 4a15c3b89a..47e3b7c152 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1044,6 +1044,7 @@ f! {
}
extern "C" {
+ pub fn __errno_location() -> *mut ::c_int;
pub fn setgrent();
pub fn mprotect(
addr: *mut ::c_void,
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 1b55078d5a..e49703e0da 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -254,6 +254,8 @@ pub const FIOGETOWN: ::c_ulong = 0x4004667b;
pub const PATH_MAX: ::c_int = 1024;
+pub const IOV_MAX: ::c_int = 1024;
+
pub const SA_ONSTACK: ::c_int = 0x0001;
pub const SA_SIGINFO: ::c_int = 0x0040;
pub const SA_RESTART: ::c_int = 0x0002;
@@ -504,6 +506,10 @@ pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const ITIMER_REAL: ::c_int = 0;
+pub const ITIMER_VIRTUAL: ::c_int = 1;
+pub const ITIMER_PROF: ::c_int = 2;
+
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
@@ -847,6 +853,23 @@ extern "C" {
options: ::c_int,
rusage: *mut ::rusage,
) -> ::pid_t;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "getitimer$UNIX2003"
+ )]
+ pub fn getitimer(
+ which: ::c_int,
+ curr_value: *mut ::itimerval
+ ) -> ::c_int;
+ #[cfg_attr(
+ all(target_os = "macos", target_arch = "x86"),
+ link_name = "setitimer$UNIX2003"
+ )]
+ pub fn setitimer(
+ which: ::c_int,
+ new_value: *const ::itimerval,
+ old_value: *mut ::itimerval,
+ ) -> ::c_int;
pub fn regcomp(
preg: *mut regex_t,
diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
index d7e06cd21c..88c252ea6c 100644
--- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -170,7 +170,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
-pub const MAP_SYNC : ::c_int = 0x080000;
+pub const MAP_SYNC: ::c_int = 0x080000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
@@ -284,6 +284,10 @@ pub const SYS_umount2: ::c_long = 39;
pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
pub const SYS_nfsservctl: ::c_long = 42;
+pub const SYS_statfs: ::c_long = 43;
+pub const SYS_fstatfs: ::c_long = 44;
+pub const SYS_truncate: ::c_long = 45;
+pub const SYS_ftruncate: ::c_long = 46;
pub const SYS_fallocate: ::c_long = 47;
pub const SYS_faccessat: ::c_long = 48;
pub const SYS_chdir: ::c_long = 49;
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index e59ff5c622..2fc872b565 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -847,6 +847,8 @@ pub const SS_DISABLE: ::c_int = 2;
pub const PATH_MAX: ::c_int = 4096;
+pub const UIO_MAXIOV: ::c_int = 1024;
+
pub const FD_SETSIZE: usize = 1024;
pub const EPOLLIN: ::c_int = 0x1;
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 532e5aa6cf..9b1daeb659 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -2266,6 +2266,15 @@ extern "C" {
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
+ pub fn pthread_getattr_np(
+ thread: ::pthread_t,
+ attr: *mut ::pthread_attr_t,
+ ) -> ::c_int;
+ pub fn pthread_attr_getstack(
+ attr: *const ::pthread_attr_t,
+ stackaddr: *mut *mut ::c_void,
+ stacksize: *mut ::size_t,
+ ) -> ::c_int;
pub fn pthread_condattr_getclock(
attr: *const pthread_condattr_t,
clock_id: *mut clockid_t,
diff --git a/src/wasi.rs b/src/wasi.rs
index 6a26858694..12db506417 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -202,6 +202,7 @@ pub const O_SEARCH: c_int = 0x08000000;
pub const O_WRONLY: c_int = 0x10000000;
pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
+pub const O_NOCTTY: c_int = 0x0;
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const POSIX_FADV_NORMAL: c_int = 0;
@@ -230,6 +231,17 @@ pub const DT_REG: u8 = 4;
pub const DT_LNK: u8 = 7;
pub const FIONREAD: c_int = 1;
pub const FIONBIO: c_int = 2;
+pub const F_OK: ::c_int = 0;
+pub const R_OK: ::c_int = 4;
+pub const W_OK: ::c_int = 2;
+pub const X_OK: ::c_int = 1;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLOUT: ::c_short = 0x2;
+pub const POLLERR: ::c_short = 0x1000;
+pub const POLLHUP: ::c_short = 0x2000;
+pub const POLLNVAL: ::c_short = 0x4000;
+pub const POLLRDNORM: ::c_short = 0x1;
+pub const POLLWRNORM: ::c_short = 0x2;
pub const E2BIG: c_int = 1;
pub const EACCES: c_int = 2;