Support SIGEV_SIGNAL and TIMER_ABSTIME
This commit is contained in:
@@ -726,25 +726,45 @@ impl Pal for Sys {
|
||||
e_raw(unsafe { syscall!(SYNC) }).map(|_| ())
|
||||
}
|
||||
|
||||
fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> Result<()> {
|
||||
e_raw(unsafe { syscall!(TIMER_CREATE, clock_id, evp, timerid) }).map(|_| ())
|
||||
fn timer_create(clock_id: clockid_t, evp: &sigevent, mut timerid: Out<timer_t>) -> Result<()> {
|
||||
e_raw(unsafe {
|
||||
syscall!(
|
||||
TIMER_CREATE,
|
||||
clock_id,
|
||||
ptr::addr_of!(evp),
|
||||
timerid.as_mut_ptr()
|
||||
)
|
||||
})
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
fn timer_delete(timerid: timer_t) -> Result<()> {
|
||||
e_raw(unsafe { syscall!(TIMER_DELETE, timerid) }).map(|_| ())
|
||||
}
|
||||
|
||||
fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> Result<()> {
|
||||
e_raw(unsafe { syscall!(TIMER_GETTIME, timerid, value) }).map(|_| ())
|
||||
fn timer_gettime(timerid: timer_t, mut value: Out<itimerspec>) -> Result<()> {
|
||||
e_raw(unsafe { syscall!(TIMER_GETTIME, timerid, value.as_mut_ptr()) }).map(|_| ())
|
||||
}
|
||||
|
||||
fn timer_settime(
|
||||
timerid: timer_t,
|
||||
flags: c_int,
|
||||
value: *const itimerspec,
|
||||
ovalue: *mut itimerspec,
|
||||
value: &itimerspec,
|
||||
mut ovalue: Option<Out<itimerspec>>,
|
||||
) -> Result<()> {
|
||||
e_raw(unsafe { syscall!(TIMER_SETTIME, timerid, flags, value, ovalue) }).map(|_| ())
|
||||
e_raw(unsafe {
|
||||
syscall!(
|
||||
TIMER_SETTIME,
|
||||
timerid,
|
||||
flags,
|
||||
ptr::addr_of!(value),
|
||||
match ovalue {
|
||||
None => ptr::null_mut(),
|
||||
Some(mut o) => o.as_mut_ptr(),
|
||||
}
|
||||
)
|
||||
})
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
fn umask(mask: mode_t) -> mode_t {
|
||||
|
||||
Reference in New Issue
Block a user