Skip to content

Commit f1fc19f

Browse files
committed
Auto merge of rust-lang#604 - Uplifting:posix, r=alexcrichton
Fill in sys/sem.h as well as getitimer and setitimer struct semun is not implemented and neither is semtimedop.
2 parents 30b0ecc + eaaa277 commit f1fc19f

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ fn main() {
173173
cfg.header("sys/xattr.h");
174174
}
175175
cfg.header("sys/ipc.h");
176+
cfg.header("sys/sem.h");
176177
cfg.header("sys/msg.h");
177178
cfg.header("sys/shm.h");
178179
cfg.header("sys/fsuid.h");

src/unix/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ s! {
124124
// Actually a union of an int and a void*
125125
pub sival_ptr: *mut ::c_void
126126
}
127+
128+
pub struct itimerval {
129+
pub it_interval: ::timeval,
130+
pub it_value: ::timeval,
131+
}
127132
}
128133

129134
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;

src/unix/notbsd/linux/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ s! {
225225
pub msg_hdr: ::msghdr,
226226
pub msg_len: ::c_uint,
227227
}
228+
229+
pub struct sembuf {
230+
pub sem_num: ::c_ushort,
231+
pub sem_op: ::c_short,
232+
pub sem_flg: ::c_short,
233+
}
228234
}
229235

230236
pub const ABDAY_1: ::nl_item = 0x20000;
@@ -796,6 +802,11 @@ extern {
796802
cmd: ::c_int,
797803
buf: *mut ::shmid_ds) -> ::c_int;
798804
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
805+
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
806+
pub fn semop(semid: ::c_int,
807+
sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
808+
pub fn semctl(semid: ::c_int,
809+
semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
799810
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
800811
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
801812
pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,

0 commit comments

Comments
 (0)