Skip to content

dragonflybsd add shm api. #2342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,10 @@ settimeofday
setutxdb
setutxent
sf_hdtr
shmat
shmctl
shmdt
shmget
sigaltstack
sigevent
siginfo_t
Expand Down
18 changes: 18 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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! {
Expand Down Expand Up @@ -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")]
Expand Down
10 changes: 0 additions & 10 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ s! {
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,
Expand Down
10 changes: 10 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,16 @@ s! {
pub dlpi_tls_modid: usize,
pub dlpi_tls_data: *mut ::c_void,
}

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,
}
}

s_no_extra_traits! {
Expand Down