Skip to content

Commit 2364caf

Browse files
nickrobinsonJohnTitor
authored andcommitted
feat(android): add timer_[create, delete, getoverrun, gettime, settime]
Add timer_create, timer_delete, timer_getoverrun, timer_gettime, and timer_settime to the Android extern block. These are standard POSIX per-process timer functions provided by Bionic but missing from the libc crate's Android bindings.
1 parent 7491ac8 commit 2364caf

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

libc-test/semver/android.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,6 +4075,11 @@ tgkill
40754075
time
40764076
time_t
40774077
timegm
4078+
timer_create
4079+
timer_delete
4080+
timer_getoverrun
4081+
timer_gettime
4082+
timer_settime
40784083
timerfd_create
40794084
timerfd_gettime
40804085
timerfd_settime

src/unix/linux_like/android/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,6 +3501,20 @@ extern "C" {
35013501
new_value: *const itimerspec,
35023502
old_value: *mut itimerspec,
35033503
) -> c_int;
3504+
pub fn timer_create(
3505+
clockid: crate::clockid_t,
3506+
sevp: *mut crate::sigevent,
3507+
timerid: *mut crate::timer_t,
3508+
) -> c_int;
3509+
pub fn timer_delete(timerid: crate::timer_t) -> c_int;
3510+
pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int;
3511+
pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int;
3512+
pub fn timer_settime(
3513+
timerid: crate::timer_t,
3514+
flags: c_int,
3515+
new_value: *const crate::itimerspec,
3516+
old_value: *mut crate::itimerspec,
3517+
) -> c_int;
35043518
pub fn syscall(num: c_long, ...) -> c_long;
35053519
pub fn sched_getaffinity(
35063520
pid: crate::pid_t,

0 commit comments

Comments
 (0)