.\" FIXME Linux 3.0: timerfd_settime() adds a TFD_TIMER_CANCEL_ON_SET flag;
.\" This flag needs to documented.
.\"
-.TH TIMERFD_CREATE 2 2017-09-15 Linux "Linux Programmer's Manual"
+.TH TIMERFD_CREATE 2 2019-03-06 Linux "Linux Programmer's Manual"
.SH NAME
timerfd_create, timerfd_settime, timerfd_gettime \-
timers that notify via file descriptors
#include <stdio.h>
#include <stdint.h> /* Definition of uint64_t */
-#define handle_error(msg) \\
+#define handle_error(msg) \e
do { perror(msg); exit(EXIT_FAILURE); } while (0)
static void
ssize_t s;
if ((argc != 2) && (argc != 4)) {
- fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\\n",
+ fprintf(stderr, "%s init\-secs [interval\-secs max\-exp]\en",
argv[0]);
exit(EXIT_FAILURE);
}
handle_error("timerfd_settime");
print_elapsed_time();
- printf("timer started\\n");
+ printf("timer started\en");
for (tot_exp = 0; tot_exp < max_exp;) {
s = read(fd, &exp, sizeof(uint64_t));
tot_exp += exp;
print_elapsed_time();
- printf("read: %llu; total=%llu\\n",
+ printf("read: %llu; total=%llu\en",
(unsigned long long) exp,
(unsigned long long) tot_exp);
}