Error conditions, other considerations
Error conditions, other considerations
Posted Oct 3, 2007 21:18 UTC (Wed) by mkerrisk (subscriber, #1978)In reply to: Error conditions, other considerations by filker0
Parent article: The new timerfd() API
The right place to ask these (good) questions is of the developer, on the kernel mailing list. But, here goes:
> 1. What error is returned if a non-timer fd is used in a
> call to timerfd_settime() or timerfd_gettime()?
I have not tested this, but it should give EINVAL.
> 2. What error is returned (if any) when a timer fd is passed to close()?
That is not an error. See the man page:
http://thread.gmane.org/gmane.linux.kernel/584510
> 3. Are the timer fds unique across the entire system?
No.
> 4. Are timer fds inherited or duplicated across a fork? Exec?
Yes and yes.
> 5. Are timers destroyed when the process ends?
The file descriptor is closed. If some other process has a file descriptor (because of fork(), for example), then I believe the timer should continue to exist. This should be tested.
> 6. Can one process set a timer for another?
See 5.
