public void setTimeout(TimeSpan timeout) { if (fd < 0) { throw new ApplicationException("The timer was not created"); } if (timeout.Ticks <= 0) { throw new ArgumentOutOfRangeException("The time is in the past"); } sTimerDesc desc = default; desc.value = timeout; int res = LibC.timerfd_settime(fd, eTimerSetFlag.Relative, ref desc); if (res >= 0) { return; } throwError($"Unable to set the time", res); throw new ApplicationException(); }
public static extern int timerfd_settime(int fd, eTimerSetFlag flags, [In] ref sTimerDesc desc, IntPtr oldDescOrNull = default);