| ... | @@ -1591,43 +1591,6 @@ pub fn timerfd_settime(fd: i32, flags: u32, new_value: *const itimerspec, old_va | ... | @@ -1591,43 +1591,6 @@ pub fn timerfd_settime(fd: i32, flags: u32, new_value: *const itimerspec, old_va |
| 1591 | return syscall4(.timerfd_settime, @as(usize, @bitCast(@as(isize, fd))), flags, @intFromPtr(new_value), @intFromPtr(old_value)); | 1591 | return syscall4(.timerfd_settime, @as(usize, @bitCast(@as(isize, fd))), flags, @intFromPtr(new_value), @intFromPtr(old_value)); |
| 1592 | } | 1592 | } |
| 1593 | | 1593 | |
| 1594 | pub const sigevent = extern struct { | | |
| 1595 | value: sigval, | | |
| 1596 | signo: i32, | | |
| 1597 | inotify: i32, | | |
| 1598 | libc_priv_impl: opaque {}, | | |
| 1599 | }; | | |
| 1600 | | | |
| 1601 | // Flags for sigevent sigev_inotify's field | | |
| 1602 | pub const SIGEV = enum(i32) { | | |
| 1603 | NONE = 0, | | |
| 1604 | SIGNAL = 1, | | |
| 1605 | THREAD = 2, | | |
| 1606 | THREAD_ID = 4, | | |
| 1607 | }; | | |
| 1608 | | | |
| 1609 | pub const timer_t = ?*anyopaque; | | |
| 1610 | | | |
| 1611 | pub fn timer_create(clockid: i32, sevp: *sigevent, timerid: *timer_t) usize { | | |
| 1612 | var t: timer_t = undefined; | | |
| 1613 | const rc = syscall3(.timer_create, @as(usize, @bitCast(@as(isize, clockid))), @intFromPtr(sevp), @intFromPtr(&t)); | | |
| 1614 | if (@as(isize, @bitCast(rc)) < 0) return rc; | | |
| 1615 | timerid.* = t; | | |
| 1616 | return rc; | | |
| 1617 | } | | |
| 1618 | | | |
| 1619 | pub fn timer_delete(timerid: timer_t) usize { | | |
| 1620 | return syscall1(.timer_delete, timerid); | | |
| 1621 | } | | |
| 1622 | | | |
| 1623 | pub fn timer_gettime(timerid: timer_t, curr_value: *itimerspec) usize { | | |
| 1624 | return syscall2(.timer_gettime, @intFromPtr(timerid), @intFromPtr(curr_value)); | | |
| 1625 | } | | |
| 1626 | | | |
| 1627 | pub fn timer_settime(timerid: timer_t, flags: i32, new_value: *const itimerspec, old_value: ?*itimerspec) usize { | | |
| 1628 | return syscall4(.timer_settime, @intFromPtr(timerid), @as(usize, @bitCast(@as(isize, flags))), @intFromPtr(new_value), @intFromPtr(old_value)); | | |
| 1629 | } | | |
| 1630 | | | |
| 1631 | // Flags for the 'setitimer' system call | 1594 | // Flags for the 'setitimer' system call |
| 1632 | pub const ITIMER = enum(i32) { | 1595 | pub const ITIMER = enum(i32) { |
| 1633 | REAL = 0, | 1596 | REAL = 0, |