aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/bsd/freebsdlike
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-05-29 14:07:12 -0700
committerDaniel Mueller <deso@posteo.net>2017-05-29 14:07:12 -0700
commit684c4574c09a6f2cc5a208e4505e9306602b4abc (patch)
treedaaac715140748c82f801f2e4047c57780689bc0 /libc/src/unix/bsd/freebsdlike
parent436915453f7474117234aa0cedab6f97b3b3575f (diff)
downloadnitrocli-684c4574c09a6f2cc5a208e4505e9306602b4abc.tar.gz
nitrocli-684c4574c09a6f2cc5a208e4505e9306602b4abc.tar.bz2
Update libc crate to 0.2.23
The 'libc' create got a couple of updates. This change imports the new code and bumps the version to use. Import subrepo libc/:libc at 7db3fd570dfb41a38fb17116e93679307178103a
Diffstat (limited to 'libc/src/unix/bsd/freebsdlike')
-rw-r--r--libc/src/unix/bsd/freebsdlike/freebsd/mod.rs81
-rw-r--r--libc/src/unix/bsd/freebsdlike/mod.rs48
2 files changed, 98 insertions, 31 deletions
diff --git a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
index aecf228..fb113de 100644
--- a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -11,6 +11,10 @@ pub type fsblkcnt_t = ::uint64_t;
pub type fsfilcnt_t = ::uint64_t;
pub type idtype_t = ::c_uint;
+pub type key_t = ::c_long;
+pub type msglen_t = ::c_ulong;
+pub type msgqnum_t = ::c_ulong;
+
s! {
pub struct utmpx {
pub ut_type: ::c_short,
@@ -88,6 +92,41 @@ s! {
pub struct _sem {
data: [u32; 4],
}
+
+ pub struct ipc_perm {
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub mode: ::mode_t,
+ pub seq: ::c_ushort,
+ pub key: ::key_t,
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ __unused1: *mut ::c_void,
+ __unused2: *mut ::c_void,
+ pub msg_cbytes: ::msglen_t,
+ pub msg_qnum: ::msgqnum_t,
+ pub msg_qbytes: ::msglen_t,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ pub msg_stime: ::time_t,
+ pub msg_rtime: ::time_t,
+ pub msg_ctime: ::time_t,
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ::ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: ::c_int,
+ pub shm_atime: ::time_t,
+ pub shm_dtime: ::time_t,
+ pub shm_ctime: ::time_t,
+ }
}
pub const SIGEV_THREAD_ID: ::c_int = 4;
@@ -368,6 +407,8 @@ pub const AF_INET6_SDP: ::c_int = 42;
#[doc(hidden)]
pub const AF_MAX: ::c_int = 42;
+pub const IPPROTO_DIVERT: ::c_int = 258;
+
pub const PF_SLOW: ::c_int = AF_SLOW;
pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
pub const PF_ARP: ::c_int = AF_ARP;
@@ -384,6 +425,28 @@ pub const NET_RT_IFLIST: ::c_int = 3;
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;
+pub const SHM_INFO: ::c_int = 14;
+
// The *_MAXID constants never should've been used outside of the
// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID,
// they were all removed in svn r262489. They remain here for backwards
@@ -442,6 +505,9 @@ pub const P_PID: idtype_t = 0;
pub const P_PGID: idtype_t = 2;
pub const P_ALL: idtype_t = 7;
+pub const B460800: ::speed_t = 460800;
+pub const B921600: ::speed_t = 921600;
+
extern {
pub fn __error() -> *mut ::c_int;
@@ -478,6 +544,21 @@ extern {
pub fn freelocale(loc: ::locale_t) -> ::c_int;
pub fn waitid(idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t,
options: ::c_int) -> ::c_int;
+
+ pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
+ pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
+ pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void,
+ shmflg: ::c_int) -> *mut ::c_void;
+ pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int,
+ buf: *mut ::shmid_ds) -> ::c_int;
+ pub fn msgctl(msqid: ::c_int, cmd: ::c_int,
+ buf: *mut ::msqid_ds) -> ::c_int;
+ pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
+ pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
+ msgtyp: ::c_long, msgflg: ::c_int) -> ::c_int;
+ pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
+ msgflg: ::c_int) -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/bsd/freebsdlike/mod.rs b/libc/src/unix/bsd/freebsdlike/mod.rs
index f9c8dcb..daf3f29 100644
--- a/libc/src/unix/bsd/freebsdlike/mod.rs
+++ b/libc/src/unix/bsd/freebsdlike/mod.rs
@@ -452,6 +452,11 @@ pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
+pub const AT_EACCESS: ::c_int = 0x100;
+pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
+pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
+pub const AT_REMOVEDIR: ::c_int = 0x800;
+
pub const SIGTRAP: ::c_int = 5;
pub const GLOB_APPEND : ::c_int = 0x0001;
@@ -864,13 +869,15 @@ pub const B57600: speed_t = 57600;
pub const B76800: speed_t = 76800;
pub const B115200: speed_t = 115200;
pub const B230400: speed_t = 230400;
-pub const B460800: speed_t = 460800;
-pub const B921600: speed_t = 921600;
pub const EXTA: speed_t = 19200;
pub const EXTB: speed_t = 38400;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
+pub const CRTSCTS: ::tcflag_t = 0x00030000;
+
+pub const AT_FDCWD: ::c_int = -100;
+
f! {
pub fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
@@ -980,6 +987,8 @@ extern {
base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
+ pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
+ addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_attr_get_np(tid: ::pthread_t,
attr: *mut ::pthread_attr_t) -> ::c_int;
@@ -999,35 +1008,12 @@ extern {
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
- pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
- flags: ::c_int, ...) -> ::c_int;
- pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::c_int, flags: ::c_int) -> ::c_int;
- pub fn fchmodat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::mode_t, flags: ::c_int) -> ::c_int;
- pub fn fchownat(dirfd: ::c_int, pathname: *const ::c_char,
- owner: ::uid_t, group: ::gid_t,
- flags: ::c_int) -> ::c_int;
- pub fn fstatat(dirfd: ::c_int, pathname: *const ::c_char,
- buf: *mut stat, flags: ::c_int) -> ::c_int;
- pub fn linkat(olddirfd: ::c_int, oldpath: *const ::c_char,
- newdirfd: ::c_int, newpath: *const ::c_char,
- flags: ::c_int) -> ::c_int;
- pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::mode_t) -> ::c_int;
- pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::mode_t, dev: dev_t) -> ::c_int;
- pub fn readlinkat(dirfd: ::c_int, pathname: *const ::c_char,
- buf: *mut ::c_char, bufsiz: ::size_t) -> ::ssize_t;
- pub fn renameat(olddirfd: ::c_int, oldpath: *const ::c_char,
- newdirfd: ::c_int, newpath: *const ::c_char)
- -> ::c_int;
- pub fn symlinkat(target: *const ::c_char, newdirfd: ::c_int,
- linkpath: *const ::c_char) -> ::c_int;
- pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
- flags: ::c_int) -> ::c_int;
- pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
- mode: ::mode_t) -> ::c_int;
+ pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
+
+ pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
+ mode: ::mode_t, dev: dev_t) -> ::c_int;
+ pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
+ mode: ::mode_t) -> ::c_int;
pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
clock_id: *mut clockid_t) -> ::c_int;
pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,