diff options
author | DC <devnexen@gmail.com> | 2021-08-14 15:03:58 +0100 |
---|---|---|
committer | DC <devnexen@gmail.com> | 2021-08-14 15:03:58 +0100 |
commit | 7db9ffd68686e1c736d3cd38014e6db7fa28cea7 (patch) | |
tree | 0e384dd1cb861d609ffcb4dac0f013bd5a4be25a /src/unix/bsd/freebsdlike/dragonfly/mod.rs | |
parent | ecead080ba15d478592947c2c72fd123d078a61a (diff) | |
download | rust-libc-7db9ffd68686e1c736d3cd38014e6db7fa28cea7.tar.gz |
dragonflybsd add shm api.
Diffstat (limited to 'src/unix/bsd/freebsdlike/dragonfly/mod.rs')
-rw-r--r-- | src/unix/bsd/freebsdlike/dragonfly/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 7a620f3886..0eaac54010 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -18,6 +18,7 @@ pub type uuid_t = ::uuid; pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type idtype_t = ::c_uint; +pub type shmatt_t = ::c_uint; pub type mqd_t = ::c_int; pub type sem_t = *mut sem; @@ -197,6 +198,18 @@ s! { pub struct cpumask_t { ary: [u64; 4], } + + 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: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + shm_internal: *mut ::c_void, + } } s_no_extra_traits! { @@ -1283,6 +1296,11 @@ extern "C" { pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t) -> ::c_int; pub fn setproctitle(fmt: *const ::c_char, ...); + + 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; } #[link(name = "rt")] |