Skip to content

Commit 548e4cf

Browse files
author
Andrew Salmon
committed
fill out sys/sem.h
semget, semop, semctl; semtimedop not implemented and struct semun not defined
1 parent e976c37 commit 548e4cf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/unix/notbsd/linux/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,20 @@ s! {
225225
pub msg_hdr: ::msghdr,
226226
pub msg_len: ::c_uint,
227227
}
228+
229+
pub struct sembuf {
230+
pub semval: ::c_ushort,
231+
pub semzcnt: ::c_ushort,
232+
pub semncnt: ::c_ushort,
233+
pub sempid: ::pid_t,
234+
}
235+
236+
pub struct semid_ds {
237+
pub sem_perm: ::ipc_perm,
238+
pub sem_otime: ::time_t,
239+
pub sem_ctime: ::time_t,
240+
pub sem_nsems: ::c_ulong,
241+
}
228242
}
229243

230244
pub const ABDAY_1: ::nl_item = 0x20000;
@@ -796,6 +810,9 @@ extern {
796810
cmd: ::c_int,
797811
buf: *mut ::shmid_ds) -> ::c_int;
798812
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
813+
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
814+
pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
815+
pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
799816
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
800817
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
801818
pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,

0 commit comments

Comments
 (0)