aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/bsd/netbsdlike/openbsd
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/bsd/netbsdlike/openbsd')
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs2
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsd/mod.rs458
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs8
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsd/x86.rs2
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs2
5 files changed, 276 insertions, 196 deletions
diff --git a/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
index 6a8cbb5..99350ec 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs
@@ -12,3 +12,5 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
index a397d58..89a3354 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -306,6 +306,21 @@ s! {
pub ar_pln: u8,
pub ar_op: u16,
}
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::c_int,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: ::c_short,
+ pub shm_atime: ::time_t,
+ __shm_atimensec: c_long,
+ pub shm_dtime: ::time_t,
+ __shm_dtimensec: c_long,
+ pub shm_ctime: ::time_t,
+ __shm_ctimensec: c_long,
+ pub shm_internal: *mut ::c_void,
+ }
}
impl siginfo_t {
@@ -728,25 +743,28 @@ pub const O_CLOEXEC: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x20000;
pub const O_RSYNC: ::c_int = O_SYNC;
-pub const MS_SYNC : ::c_int = 0x0002;
-pub const MS_INVALIDATE : ::c_int = 0x0004;
+pub const MS_SYNC: ::c_int = 0x0002;
+pub const MS_INVALIDATE: ::c_int = 0x0004;
pub const POLLNORM: ::c_short = ::POLLRDNORM;
-pub const ENOATTR : ::c_int = 83;
-pub const EILSEQ : ::c_int = 84;
-pub const EOVERFLOW : ::c_int = 87;
-pub const ECANCELED : ::c_int = 88;
-pub const EIDRM : ::c_int = 89;
-pub const ENOMSG : ::c_int = 90;
-pub const ENOTSUP : ::c_int = 91;
-pub const EBADMSG : ::c_int = 92;
-pub const ENOTRECOVERABLE : ::c_int = 93;
-pub const EOWNERDEAD : ::c_int = 94;
-pub const EPROTO : ::c_int = 95;
-pub const ELAST : ::c_int = 95;
-
-pub const F_DUPFD_CLOEXEC : ::c_int = 10;
+pub const ENOATTR: ::c_int = 83;
+pub const EILSEQ: ::c_int = 84;
+pub const EOVERFLOW: ::c_int = 87;
+pub const ECANCELED: ::c_int = 88;
+pub const EIDRM: ::c_int = 89;
+pub const ENOMSG: ::c_int = 90;
+pub const ENOTSUP: ::c_int = 91;
+pub const EBADMSG: ::c_int = 92;
+pub const ENOTRECOVERABLE: ::c_int = 93;
+pub const EOWNERDEAD: ::c_int = 94;
+pub const EPROTO: ::c_int = 95;
+pub const ELAST: ::c_int = 95;
+
+pub const F_DUPFD_CLOEXEC: ::c_int = 10;
+
+pub const UTIME_OMIT: c_long = -1;
+pub const UTIME_NOW: c_long = -2;
pub const AT_FDCWD: ::c_int = -100;
pub const AT_EACCESS: ::c_int = 0x01;
@@ -754,6 +772,7 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04;
pub const AT_REMOVEDIR: ::c_int = 0x08;
+#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 9;
pub const SO_TIMESTAMP: ::c_int = 0x0800;
@@ -827,8 +846,7 @@ pub const IPPROTO_MPLS: ::c_int = 137;
pub const IPPROTO_PFSYNC: ::c_int = 240;
pub const IPPROTO_MAX: ::c_int = 256;
-/* Only used internally, so it can be outside the range of valid IP protocols */
-/// Divert sockets
+// Only used internally, so it can be outside the range of valid IP protocols
pub const IPPROTO_DIVERT: ::c_int = 258;
pub const IP_RECVDSTADDR: ::c_int = 7;
@@ -874,15 +892,15 @@ pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX;
pub const SCM_TIMESTAMP: ::c_int = 0x04;
-pub const O_DSYNC : ::c_int = 128;
+pub const O_DSYNC: ::c_int = 128;
-pub const MAP_RENAME : ::c_int = 0x0000;
-pub const MAP_NORESERVE : ::c_int = 0x0000;
-pub const MAP_HASSEMAPHORE : ::c_int = 0x0000;
+pub const MAP_RENAME: ::c_int = 0x0000;
+pub const MAP_NORESERVE: ::c_int = 0x0000;
+pub const MAP_HASSEMAPHORE: ::c_int = 0x0000;
-pub const EIPSEC : ::c_int = 82;
-pub const ENOMEDIUM : ::c_int = 85;
-pub const EMEDIUMTYPE : ::c_int = 86;
+pub const EIPSEC: ::c_int = 82;
+pub const ENOMEDIUM: ::c_int = 85;
+pub const EMEDIUMTYPE: ::c_int = 86;
pub const EAI_BADFLAGS: ::c_int = -1;
pub const EAI_NONAME: ::c_int = -2;
@@ -898,131 +916,131 @@ pub const EAI_OVERFLOW: ::c_int = -14;
pub const RUSAGE_THREAD: ::c_int = 1;
-pub const MAP_COPY : ::c_int = 0x0002;
-pub const MAP_NOEXTEND : ::c_int = 0x0000;
-
-pub const _PC_LINK_MAX : ::c_int = 1;
-pub const _PC_MAX_CANON : ::c_int = 2;
-pub const _PC_MAX_INPUT : ::c_int = 3;
-pub const _PC_NAME_MAX : ::c_int = 4;
-pub const _PC_PATH_MAX : ::c_int = 5;
-pub const _PC_PIPE_BUF : ::c_int = 6;
-pub const _PC_CHOWN_RESTRICTED : ::c_int = 7;
-pub const _PC_NO_TRUNC : ::c_int = 8;
-pub const _PC_VDISABLE : ::c_int = 9;
-pub const _PC_2_SYMLINKS : ::c_int = 10;
-pub const _PC_ALLOC_SIZE_MIN : ::c_int = 11;
-pub const _PC_ASYNC_IO : ::c_int = 12;
-pub const _PC_FILESIZEBITS : ::c_int = 13;
-pub const _PC_PRIO_IO : ::c_int = 14;
-pub const _PC_REC_INCR_XFER_SIZE : ::c_int = 15;
-pub const _PC_REC_MAX_XFER_SIZE : ::c_int = 16;
-pub const _PC_REC_MIN_XFER_SIZE : ::c_int = 17;
-pub const _PC_REC_XFER_ALIGN : ::c_int = 18;
-pub const _PC_SYMLINK_MAX : ::c_int = 19;
-pub const _PC_SYNC_IO : ::c_int = 20;
-pub const _PC_TIMESTAMP_RESOLUTION : ::c_int = 21;
-
-pub const _SC_CLK_TCK : ::c_int = 3;
-pub const _SC_SEM_NSEMS_MAX : ::c_int = 31;
-pub const _SC_SEM_VALUE_MAX : ::c_int = 32;
-pub const _SC_HOST_NAME_MAX : ::c_int = 33;
-pub const _SC_MONOTONIC_CLOCK : ::c_int = 34;
-pub const _SC_2_PBS : ::c_int = 35;
-pub const _SC_2_PBS_ACCOUNTING : ::c_int = 36;
-pub const _SC_2_PBS_CHECKPOINT : ::c_int = 37;
-pub const _SC_2_PBS_LOCATE : ::c_int = 38;
-pub const _SC_2_PBS_MESSAGE : ::c_int = 39;
-pub const _SC_2_PBS_TRACK : ::c_int = 40;
-pub const _SC_ADVISORY_INFO : ::c_int = 41;
-pub const _SC_AIO_LISTIO_MAX : ::c_int = 42;
-pub const _SC_AIO_MAX : ::c_int = 43;
-pub const _SC_AIO_PRIO_DELTA_MAX : ::c_int = 44;
-pub const _SC_ASYNCHRONOUS_IO : ::c_int = 45;
-pub const _SC_ATEXIT_MAX : ::c_int = 46;
-pub const _SC_BARRIERS : ::c_int = 47;
-pub const _SC_CLOCK_SELECTION : ::c_int = 48;
-pub const _SC_CPUTIME : ::c_int = 49;
-pub const _SC_DELAYTIMER_MAX : ::c_int = 50;
-pub const _SC_IOV_MAX : ::c_int = 51;
-pub const _SC_IPV6 : ::c_int = 52;
-pub const _SC_MAPPED_FILES : ::c_int = 53;
-pub const _SC_MEMLOCK : ::c_int = 54;
-pub const _SC_MEMLOCK_RANGE : ::c_int = 55;
-pub const _SC_MEMORY_PROTECTION : ::c_int = 56;
-pub const _SC_MESSAGE_PASSING : ::c_int = 57;
-pub const _SC_MQ_OPEN_MAX : ::c_int = 58;
-pub const _SC_MQ_PRIO_MAX : ::c_int = 59;
-pub const _SC_PRIORITIZED_IO : ::c_int = 60;
-pub const _SC_PRIORITY_SCHEDULING : ::c_int = 61;
-pub const _SC_RAW_SOCKETS : ::c_int = 62;
-pub const _SC_READER_WRITER_LOCKS : ::c_int = 63;
-pub const _SC_REALTIME_SIGNALS : ::c_int = 64;
-pub const _SC_REGEXP : ::c_int = 65;
-pub const _SC_RTSIG_MAX : ::c_int = 66;
-pub const _SC_SEMAPHORES : ::c_int = 67;
-pub const _SC_SHARED_MEMORY_OBJECTS : ::c_int = 68;
-pub const _SC_SHELL : ::c_int = 69;
-pub const _SC_SIGQUEUE_MAX : ::c_int = 70;
-pub const _SC_SPAWN : ::c_int = 71;
-pub const _SC_SPIN_LOCKS : ::c_int = 72;
-pub const _SC_SPORADIC_SERVER : ::c_int = 73;
-pub const _SC_SS_REPL_MAX : ::c_int = 74;
-pub const _SC_SYNCHRONIZED_IO : ::c_int = 75;
-pub const _SC_SYMLOOP_MAX : ::c_int = 76;
-pub const _SC_THREAD_ATTR_STACKADDR : ::c_int = 77;
-pub const _SC_THREAD_ATTR_STACKSIZE : ::c_int = 78;
-pub const _SC_THREAD_CPUTIME : ::c_int = 79;
-pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : ::c_int = 80;
-pub const _SC_THREAD_KEYS_MAX : ::c_int = 81;
-pub const _SC_THREAD_PRIO_INHERIT : ::c_int = 82;
-pub const _SC_THREAD_PRIO_PROTECT : ::c_int = 83;
-pub const _SC_THREAD_PRIORITY_SCHEDULING : ::c_int = 84;
-pub const _SC_THREAD_PROCESS_SHARED : ::c_int = 85;
-pub const _SC_THREAD_ROBUST_PRIO_INHERIT : ::c_int = 86;
-pub const _SC_THREAD_ROBUST_PRIO_PROTECT : ::c_int = 87;
-pub const _SC_THREAD_SPORADIC_SERVER : ::c_int = 88;
-pub const _SC_THREAD_STACK_MIN : ::c_int = 89;
-pub const _SC_THREAD_THREADS_MAX : ::c_int = 90;
-pub const _SC_THREADS : ::c_int = 91;
-pub const _SC_TIMEOUTS : ::c_int = 92;
-pub const _SC_TIMER_MAX : ::c_int = 93;
-pub const _SC_TIMERS : ::c_int = 94;
-pub const _SC_TRACE : ::c_int = 95;
-pub const _SC_TRACE_EVENT_FILTER : ::c_int = 96;
-pub const _SC_TRACE_EVENT_NAME_MAX : ::c_int = 97;
-pub const _SC_TRACE_INHERIT : ::c_int = 98;
-pub const _SC_TRACE_LOG : ::c_int = 99;
-pub const _SC_GETGR_R_SIZE_MAX : ::c_int = 100;
-pub const _SC_GETPW_R_SIZE_MAX : ::c_int = 101;
-pub const _SC_LOGIN_NAME_MAX : ::c_int = 102;
-pub const _SC_THREAD_SAFE_FUNCTIONS : ::c_int = 103;
-pub const _SC_TRACE_NAME_MAX : ::c_int = 104;
-pub const _SC_TRACE_SYS_MAX : ::c_int = 105;
-pub const _SC_TRACE_USER_EVENT_MAX : ::c_int = 106;
-pub const _SC_TTY_NAME_MAX : ::c_int = 107;
-pub const _SC_TYPED_MEMORY_OBJECTS : ::c_int = 108;
-pub const _SC_V6_ILP32_OFF32 : ::c_int = 109;
-pub const _SC_V6_ILP32_OFFBIG : ::c_int = 110;
-pub const _SC_V6_LP64_OFF64 : ::c_int = 111;
-pub const _SC_V6_LPBIG_OFFBIG : ::c_int = 112;
-pub const _SC_V7_ILP32_OFF32 : ::c_int = 113;
-pub const _SC_V7_ILP32_OFFBIG : ::c_int = 114;
-pub const _SC_V7_LP64_OFF64 : ::c_int = 115;
-pub const _SC_V7_LPBIG_OFFBIG : ::c_int = 116;
-pub const _SC_XOPEN_CRYPT : ::c_int = 117;
-pub const _SC_XOPEN_ENH_I18N : ::c_int = 118;
-pub const _SC_XOPEN_LEGACY : ::c_int = 119;
-pub const _SC_XOPEN_REALTIME : ::c_int = 120;
-pub const _SC_XOPEN_REALTIME_THREADS : ::c_int = 121;
-pub const _SC_XOPEN_STREAMS : ::c_int = 122;
-pub const _SC_XOPEN_UNIX : ::c_int = 123;
-pub const _SC_XOPEN_UUCP : ::c_int = 124;
-pub const _SC_XOPEN_VERSION : ::c_int = 125;
-pub const _SC_PHYS_PAGES : ::c_int = 500;
-pub const _SC_AVPHYS_PAGES : ::c_int = 501;
-pub const _SC_NPROCESSORS_CONF : ::c_int = 502;
-pub const _SC_NPROCESSORS_ONLN : ::c_int = 503;
+pub const MAP_COPY: ::c_int = 0x0002;
+pub const MAP_NOEXTEND: ::c_int = 0x0000;
+
+pub const _PC_LINK_MAX: ::c_int = 1;
+pub const _PC_MAX_CANON: ::c_int = 2;
+pub const _PC_MAX_INPUT: ::c_int = 3;
+pub const _PC_NAME_MAX: ::c_int = 4;
+pub const _PC_PATH_MAX: ::c_int = 5;
+pub const _PC_PIPE_BUF: ::c_int = 6;
+pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
+pub const _PC_NO_TRUNC: ::c_int = 8;
+pub const _PC_VDISABLE: ::c_int = 9;
+pub const _PC_2_SYMLINKS: ::c_int = 10;
+pub const _PC_ALLOC_SIZE_MIN: ::c_int = 11;
+pub const _PC_ASYNC_IO: ::c_int = 12;
+pub const _PC_FILESIZEBITS: ::c_int = 13;
+pub const _PC_PRIO_IO: ::c_int = 14;
+pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 15;
+pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 16;
+pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 17;
+pub const _PC_REC_XFER_ALIGN: ::c_int = 18;
+pub const _PC_SYMLINK_MAX: ::c_int = 19;
+pub const _PC_SYNC_IO: ::c_int = 20;
+pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 21;
+
+pub const _SC_CLK_TCK: ::c_int = 3;
+pub const _SC_SEM_NSEMS_MAX: ::c_int = 31;
+pub const _SC_SEM_VALUE_MAX: ::c_int = 32;
+pub const _SC_HOST_NAME_MAX: ::c_int = 33;
+pub const _SC_MONOTONIC_CLOCK: ::c_int = 34;
+pub const _SC_2_PBS: ::c_int = 35;
+pub const _SC_2_PBS_ACCOUNTING: ::c_int = 36;
+pub const _SC_2_PBS_CHECKPOINT: ::c_int = 37;
+pub const _SC_2_PBS_LOCATE: ::c_int = 38;
+pub const _SC_2_PBS_MESSAGE: ::c_int = 39;
+pub const _SC_2_PBS_TRACK: ::c_int = 40;
+pub const _SC_ADVISORY_INFO: ::c_int = 41;
+pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
+pub const _SC_AIO_MAX: ::c_int = 43;
+pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
+pub const _SC_ASYNCHRONOUS_IO: ::c_int = 45;
+pub const _SC_ATEXIT_MAX: ::c_int = 46;
+pub const _SC_BARRIERS: ::c_int = 47;
+pub const _SC_CLOCK_SELECTION: ::c_int = 48;
+pub const _SC_CPUTIME: ::c_int = 49;
+pub const _SC_DELAYTIMER_MAX: ::c_int = 50;
+pub const _SC_IOV_MAX: ::c_int = 51;
+pub const _SC_IPV6: ::c_int = 52;
+pub const _SC_MAPPED_FILES: ::c_int = 53;
+pub const _SC_MEMLOCK: ::c_int = 54;
+pub const _SC_MEMLOCK_RANGE: ::c_int = 55;
+pub const _SC_MEMORY_PROTECTION: ::c_int = 56;
+pub const _SC_MESSAGE_PASSING: ::c_int = 57;
+pub const _SC_MQ_OPEN_MAX: ::c_int = 58;
+pub const _SC_MQ_PRIO_MAX: ::c_int = 59;
+pub const _SC_PRIORITIZED_IO: ::c_int = 60;
+pub const _SC_PRIORITY_SCHEDULING: ::c_int = 61;
+pub const _SC_RAW_SOCKETS: ::c_int = 62;
+pub const _SC_READER_WRITER_LOCKS: ::c_int = 63;
+pub const _SC_REALTIME_SIGNALS: ::c_int = 64;
+pub const _SC_REGEXP: ::c_int = 65;
+pub const _SC_RTSIG_MAX: ::c_int = 66;
+pub const _SC_SEMAPHORES: ::c_int = 67;
+pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68;
+pub const _SC_SHELL: ::c_int = 69;
+pub const _SC_SIGQUEUE_MAX: ::c_int = 70;
+pub const _SC_SPAWN: ::c_int = 71;
+pub const _SC_SPIN_LOCKS: ::c_int = 72;
+pub const _SC_SPORADIC_SERVER: ::c_int = 73;
+pub const _SC_SS_REPL_MAX: ::c_int = 74;
+pub const _SC_SYNCHRONIZED_IO: ::c_int = 75;
+pub const _SC_SYMLOOP_MAX: ::c_int = 76;
+pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
+pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
+pub const _SC_THREAD_CPUTIME: ::c_int = 79;
+pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 80;
+pub const _SC_THREAD_KEYS_MAX: ::c_int = 81;
+pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 82;
+pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 83;
+pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 84;
+pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 85;
+pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 86;
+pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 87;
+pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 88;
+pub const _SC_THREAD_STACK_MIN: ::c_int = 89;
+pub const _SC_THREAD_THREADS_MAX: ::c_int = 90;
+pub const _SC_THREADS: ::c_int = 91;
+pub const _SC_TIMEOUTS: ::c_int = 92;
+pub const _SC_TIMER_MAX: ::c_int = 93;
+pub const _SC_TIMERS: ::c_int = 94;
+pub const _SC_TRACE: ::c_int = 95;
+pub const _SC_TRACE_EVENT_FILTER: ::c_int = 96;
+pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 97;
+pub const _SC_TRACE_INHERIT: ::c_int = 98;
+pub const _SC_TRACE_LOG: ::c_int = 99;
+pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 100;
+pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 101;
+pub const _SC_LOGIN_NAME_MAX: ::c_int = 102;
+pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 103;
+pub const _SC_TRACE_NAME_MAX: ::c_int = 104;
+pub const _SC_TRACE_SYS_MAX: ::c_int = 105;
+pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 106;
+pub const _SC_TTY_NAME_MAX: ::c_int = 107;
+pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 108;
+pub const _SC_V6_ILP32_OFF32: ::c_int = 109;
+pub const _SC_V6_ILP32_OFFBIG: ::c_int = 110;
+pub const _SC_V6_LP64_OFF64: ::c_int = 111;
+pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 112;
+pub const _SC_V7_ILP32_OFF32: ::c_int = 113;
+pub const _SC_V7_ILP32_OFFBIG: ::c_int = 114;
+pub const _SC_V7_LP64_OFF64: ::c_int = 115;
+pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 116;
+pub const _SC_XOPEN_CRYPT: ::c_int = 117;
+pub const _SC_XOPEN_ENH_I18N: ::c_int = 118;
+pub const _SC_XOPEN_LEGACY: ::c_int = 119;
+pub const _SC_XOPEN_REALTIME: ::c_int = 120;
+pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 121;
+pub const _SC_XOPEN_STREAMS: ::c_int = 122;
+pub const _SC_XOPEN_UNIX: ::c_int = 123;
+pub const _SC_XOPEN_UUCP: ::c_int = 124;
+pub const _SC_XOPEN_VERSION: ::c_int = 125;
+pub const _SC_PHYS_PAGES: ::c_int = 500;
+pub const _SC_AVPHYS_PAGES: ::c_int = 501;
+pub const _SC_NPROCESSORS_CONF: ::c_int = 502;
+pub const _SC_NPROCESSORS_ONLN: ::c_int = 503;
pub const FD_SETSIZE: usize = 1024;
@@ -1078,7 +1096,7 @@ pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
-pub const TMP_MAX : ::c_uint = 0x7fffffff;
+pub const TMP_MAX: ::c_uint = 0x7fffffff;
pub const NI_MAXHOST: ::size_t = 256;
@@ -1277,7 +1295,7 @@ pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2;
pub const TMPFS_ARGS_VERSION: ::c_int = 1;
-pub const MAP_STACK : ::c_int = 0x4000;
+pub const MAP_STACK: ::c_int = 0x4000;
// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
pub const IFF_UP: ::c_int = 0x1; // interface is up
@@ -1297,8 +1315,9 @@ pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
-pub const PTHREAD_STACK_MIN : ::size_t = 4096;
-pub const SIGSTKSZ : ::size_t = 28672;
+pub const PTHREAD_STACK_MIN: ::size_t = (1_usize << _MAX_PAGE_SHIFT);
+pub const MINSIGSTKSZ: ::size_t = (3_usize << _MAX_PAGE_SHIFT);
+pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4;
pub const PT_FIRSTMACH: ::c_int = 32;
@@ -1306,6 +1325,10 @@ pub const SOCK_CLOEXEC: ::c_int = 0x8000;
pub const SOCK_NONBLOCK: ::c_int = 0x4000;
pub const SOCK_DNS: ::c_int = 0x1000;
+pub const BIOCGRSIG: ::c_ulong = 0x40044273;
+pub const BIOCSRSIG: ::c_ulong = 0x80044272;
+pub const BIOCSDLT: ::c_ulong = 0x8004427a;
+
pub const PTRACE_FORK: ::c_int = 0x0002;
pub const WCONTINUED: ::c_int = 8;
@@ -1364,57 +1387,97 @@ f! {
}
}
-extern {
- pub fn gettimeofday(tp: *mut ::timeval,
- tz: *mut ::timezone) -> ::c_int;
- pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
- addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
- pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char,
- envp: *const *const ::c_char) -> ::c_int;
- pub fn pledge(promises: *const ::c_char,
- execpromises: *const ::c_char) -> ::c_int;
- pub fn strtonum(nptr: *const ::c_char, minval: ::c_longlong,
- maxval: ::c_longlong,
- errstr: *mut *const ::c_char) -> ::c_longlong;
+extern "C" {
+ pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
+ pub fn settimeofday(
+ tp: *const ::timeval,
+ tz: *const ::timezone,
+ ) -> ::c_int;
+ pub fn accept4(
+ s: ::c_int,
+ addr: *mut ::sockaddr,
+ addrlen: *mut ::socklen_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn execvpe(
+ file: *const ::c_char,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
+ pub fn pledge(
+ promises: *const ::c_char,
+ execpromises: *const ::c_char,
+ ) -> ::c_int;
+ pub fn strtonum(
+ nptr: *const ::c_char,
+ minval: ::c_longlong,
+ maxval: ::c_longlong,
+ errstr: *mut *const ::c_char,
+ ) -> ::c_longlong;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
- pub fn chflagsat(fd: ::c_int, path: *const ::c_char, flags: ::c_uint,
- atflag: ::c_int) -> ::c_int;
+ pub fn chflagsat(
+ fd: ::c_int,
+ path: *const ::c_char,
+ flags: ::c_uint,
+ atflag: ::c_int,
+ ) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
- pub fn getnameinfo(sa: *const ::sockaddr,
- salen: ::socklen_t,
- host: *mut ::c_char,
- hostlen: ::size_t,
- serv: *mut ::c_char,
- servlen: ::size_t,
- flags: ::c_int) -> ::c_int;
- pub fn kevent(kq: ::c_int,
- changelist: *const ::kevent,
- nchanges: ::c_int,
- eventlist: *mut ::kevent,
- nevents: ::c_int,
- timeout: *const ::timespec) -> ::c_int;
- pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
- -> ::c_int;
+ pub fn getnameinfo(
+ sa: *const ::sockaddr,
+ salen: ::socklen_t,
+ host: *mut ::c_char,
+ hostlen: ::size_t,
+ serv: *mut ::c_char,
+ servlen: ::size_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn kevent(
+ kq: ::c_int,
+ changelist: *const ::kevent,
+ nchanges: ::c_int,
+ eventlist: *mut ::kevent,
+ nevents: ::c_int,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn mprotect(
+ addr: *mut ::c_void,
+ len: ::size_t,
+ prot: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_attr_getguardsize(
+ attr: *const ::pthread_attr_t,
+ guardsize: *mut ::size_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_main_np() -> ::c_int;
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
- pub fn pthread_stackseg_np(thread: ::pthread_t,
- sinfo: *mut ::stack_t) -> ::c_int;
- pub fn sysctl(name: *const ::c_int,
- namelen: ::c_uint,
- oldp: *mut ::c_void,
- oldlenp: *mut ::size_t,
- newp: *mut ::c_void,
- newlen: ::size_t)
- -> ::c_int;
+ pub fn pthread_stackseg_np(
+ thread: ::pthread_t,
+ sinfo: *mut ::stack_t,
+ ) -> ::c_int;
+ pub fn sysctl(
+ name: *const ::c_int,
+ namelen: ::c_uint,
+ oldp: *mut ::c_void,
+ oldlenp: *mut ::size_t,
+ newp: *mut ::c_void,
+ newlen: ::size_t,
+ ) -> ::c_int;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
- pub fn ptrace(request: ::c_int,
- pid: ::pid_t,
- addr: caddr_t,
- data: ::c_int) -> ::c_int;
+ pub fn ptrace(
+ request: ::c_int,
+ pid: ::pid_t,
+ addr: caddr_t,
+ data: ::c_int,
+ ) -> ::c_int;
}
cfg_if! {
@@ -1437,6 +1500,9 @@ cfg_if! {
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
+ } else if #[cfg(target_arch = "sparc64")] {
+ mod sparc64;
+ pub use self::sparc64::*;
} else {
// Unknown target_arch
}
diff --git a/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
new file mode 100644
index 0000000..070fc93
--- /dev/null
+++ b/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs
@@ -0,0 +1,8 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
+pub type c_char = i8;
+
+#[doc(hidden)]
+pub const _ALIGNBYTES: usize = 0xf;
+
+pub const _MAX_PAGE_SHIFT: u32 = 13;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs b/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
index 05538cd..e87d0ff 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs
@@ -12,3 +12,5 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
+
+pub const _MAX_PAGE_SHIFT: u32 = 12;
diff --git a/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
index 7daa9d8..263b6e1 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs
@@ -15,6 +15,8 @@ cfg_if! {
}
}
+pub const _MAX_PAGE_SHIFT: u32 = 12;
+
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;