public void SetInterval(long nsec) { var tm = new timespec { tv_sec = (int)(nsec / 1_000_000_000L), tv_nsec = (int)(nsec % 1_000_000_000L) }; var newValue = new itimerspec { it_value = tm, it_interval = tm }; Interops.timerfd_settime(this.Identity, 0, ref newValue, out var dummy); }
public static extern int timerfd_settime( int fd, int flags, ref itimerspec new_value, out itimerspec old_value);