diff options
Diffstat (limited to 'libc/src/unix/bsd/freebsdlike/freebsd')
| -rw-r--r-- | libc/src/unix/bsd/freebsdlike/freebsd/mod.rs | 81 | 
1 files changed, 81 insertions, 0 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! { | 
