Skip to content

Commit

Permalink
Auto merge of rust-lang#604 - Uplifting:posix, r=alexcrichton
Browse files Browse the repository at this point in the history
Fill in sys/sem.h as well as getitimer and setitimer

struct semun is not implemented and neither is semtimedop.
  • Loading branch information
bors committed May 27, 2017
2 parents 30b0ecc + eaaa277 commit f1fc19f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ fn main() {
cfg.header("sys/xattr.h");
}
cfg.header("sys/ipc.h");
cfg.header("sys/sem.h");
cfg.header("sys/msg.h");
cfg.header("sys/shm.h");
cfg.header("sys/fsuid.h");
Expand Down
5 changes: 5 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ s! {
// Actually a union of an int and a void*
pub sival_ptr: *mut ::c_void
}

pub struct itimerval {
pub it_interval: ::timeval,
pub it_value: ::timeval,
}
}

pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
Expand Down
11 changes: 11 additions & 0 deletions src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ s! {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}

pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
}

pub const ABDAY_1: ::nl_item = 0x20000;
Expand Down Expand Up @@ -796,6 +802,11 @@ extern {
cmd: ::c_int,
buf: *mut ::shmid_ds) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
pub fn semop(semid: ::c_int,
sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
pub fn semctl(semid: ::c_int,
semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
Expand Down

0 comments on commit f1fc19f

Please sign in to comment.