Skip to content

Commit 3c0a38c

Browse files
committed
Auto merge of #2342 - devnexen:dfbsd_shm_api, r=JohnTitor
dragonflybsd add shm api.
2 parents 4a6fd7c + 7db9ffd commit 3c0a38c

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

libc-test/semver/dragonfly.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,10 @@ settimeofday
13951395
setutxdb
13961396
setutxent
13971397
sf_hdtr
1398+
shmat
1399+
shmctl
1400+
shmdt
1401+
shmget
13981402
sigaltstack
13991403
sigevent
14001404
siginfo_t

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub type uuid_t = ::uuid;
1818
pub type fsblkcnt_t = u64;
1919
pub type fsfilcnt_t = u64;
2020
pub type idtype_t = ::c_uint;
21+
pub type shmatt_t = ::c_uint;
2122

2223
pub type mqd_t = ::c_int;
2324
pub type sem_t = *mut sem;
@@ -197,6 +198,18 @@ s! {
197198
pub struct cpumask_t {
198199
ary: [u64; 4],
199200
}
201+
202+
pub struct shmid_ds {
203+
pub shm_perm: ::ipc_perm,
204+
pub shm_segsz: ::size_t,
205+
pub shm_lpid: ::pid_t,
206+
pub shm_cpid: ::pid_t,
207+
pub shm_nattch: ::shmatt_t,
208+
pub shm_atime: ::time_t,
209+
pub shm_dtime: ::time_t,
210+
pub shm_ctime: ::time_t,
211+
shm_internal: *mut ::c_void,
212+
}
200213
}
201214

202215
s_no_extra_traits! {
@@ -1283,6 +1296,11 @@ extern "C" {
12831296
pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t)
12841297
-> ::c_int;
12851298
pub fn setproctitle(fmt: *const ::c_char, ...);
1299+
1300+
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
1301+
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
1302+
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
1303+
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
12861304
}
12871305

12881306
#[link(name = "rt")]

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ s! {
7171
data: [u32; 4],
7272
}
7373

74-
pub struct ipc_perm {
75-
pub cuid: ::uid_t,
76-
pub cgid: ::gid_t,
77-
pub uid: ::uid_t,
78-
pub gid: ::gid_t,
79-
pub mode: ::mode_t,
80-
pub seq: ::c_ushort,
81-
pub key: ::key_t,
82-
}
83-
8474
pub struct msqid_ds {
8575
pub msg_perm: ::ipc_perm,
8676
__unused1: *mut ::c_void,

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ s! {
345345
pub dlpi_tls_modid: usize,
346346
pub dlpi_tls_data: *mut ::c_void,
347347
}
348+
349+
pub struct ipc_perm {
350+
pub cuid: ::uid_t,
351+
pub cgid: ::gid_t,
352+
pub uid: ::uid_t,
353+
pub gid: ::gid_t,
354+
pub mode: ::mode_t,
355+
pub seq: ::c_ushort,
356+
pub key: ::key_t,
357+
}
348358
}
349359

350360
s_no_extra_traits! {

0 commit comments

Comments
 (0)