1
2TIMER_CREATE(2) Linux Programmer's Guide TIMER_CREATE(2)
3
4
5
7 timer_create - Create a POSIX.1b interval timer clock
8
10 long sys_timer_create (clockid_t which_clock,
11 struct sigevent *timer_event_spec,
12 timer_t *created_timer_id);
13
14
16 timer_create creates a POSIX.1b interval timer, pointed to by creat‐
17 ed_timer_id, using the which_clock format. The timer_event_spec points
18 to a sigevent structure if non-NULL. The sigevent structure defines the
19 asynchronous notification that occurs when the timer expires.
20
21
22 The values that clockid_t currently supports for POSIX.1b timers, as
23 defined in include/linux.time.h, are:
24
25
26 CLOCK_REALTIME
27 Systemwide realtime clock.
28
29
30 CLOCK_MONOTONIC
31 Represents monotonic time. Cannot be set.
32
33
34 CLOCK_PROCESS_CPUTIME_ID
35 High resolution per-process timer.
36
37
38 CLOCK_THREAD_CPUTIME_ID
39 Thread-specific timer.
40
41
42 CLOCK_REALTIME_HR
43 High resolution version of CLOCK_REALTIME.
44
45
46 CLOCK_MONOTONIC_HR
47 High resolution version of CLOCK_MONOTONIC.
48
49
50
52 timer_create returns 0 on success and updates the created_timer_id val‐
53 ue; otherwise, it returns one of the errors listed in the "Errors" sec‐
54 tion.
55
56
58 -EINVAL
59 An invalid which_clock value was specified.
60
61
62 -EAGAIN
63 The system could not process the request.
64
65
66 -EFAULT
67 An invalid timer_event_spec value was specified.
68
69
71 timer_delete(2), timer_getoverrun(2), timer_gettime(2), timer_set‐
72 time(2)
73
74
76 Niki Rahimi
77
78
79
80Linux 2.6 2004-March-12 TIMER_CREATE(2)