The current code only decodes TFD_TIMER_ABSTIME when the kernel has
a bunch of newer flags. We have to handle fallbacks for all of them
since the kernel doesn't currently export things to userspace.
* time.c: Include fcntl.h for O_* defines.
(TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in.
* xlat/timerfdflags.in: Add more definitions.
*/
#include "defs.h"
+#include <fcntl.h>
#include <linux/version.h>
#include <sys/timex.h>
#include <linux/ioctl.h>
return 1;
}
-#ifndef TFD_TIMER_ABSTIME
-#define TFD_TIMER_ABSTIME (1 << 0)
-#endif
-
#include "xlat/timerfdflags.h"
int
+/* The Linux userspace headers didn't export these for a long time. */
+
+#ifndef TFD_TIMER_ABSTIME
+# define TFD_TIMER_ABSTIME (1 << 0)
+#endif
TFD_TIMER_ABSTIME
+
+#ifndef TFD_TIMER_CANCEL_ON_SET
+# define TFD_TIMER_CANCEL_ON_SET (1 << 1)
+#endif
+TFD_TIMER_CANCEL_ON_SET
+
+#ifndef TFD_CLOEXEC
+# define TFD_CLOEXEC O_CLOEXEC
+#endif
+TFD_CLOEXEC
+
+#ifndef TFD_NONBLOCK
+# define TFD_NONBLOCK O_NONBLOCK
+#endif
+TFD_NONBLOCK