1 .\" $NetBSD: timer_settime.2,v 1.9 2012/11/06 23:25:44 wiz Exp $
3 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Christos Zoulas.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
37 .Nd process timer manipulation
43 .Fn timer_settime "timer_t timerid" "int flags" "const struct itimerspec * restrict tim" "struct itimerspec * restrict otim"
45 .Fn timer_gettime "timer_t timerid" "struct itimerspec *tim"
47 .Fn timer_getoverrun "timer_t timerid"
51 sets the next expiration time of the timer with ID
60 If the value is 0, the timer is disarmed.
65 the old timer settings are returned.
71 then the expiration time is set to the value in nanoseconds specified
74 argument from the time the call to
81 then the expiration time is set to be equal to the difference between the
82 clock associated with this timer, and the value specified in the
85 If that time has already passed, then the call succeeds, and the
86 expiration notification occurs.
92 argument is non-zero, then the timer reloads upon expiration.
96 function returns the current settings of the timer
103 Only one notification event (signal) can be pending for a given timer
105 If a timer expires while the signal is still queued for delivery, then
106 the overrun counter for that timer is increased.
107 The counter can store values up to
109 When the signal is finally delivered to the process, then the
111 function can be used to retrieve the overrun counter for the timer
116 Expiration time values are always rounded up to the resolution of the timer,
117 so a notification will never be sent before the requested time.
118 Values returned in the
126 are subject to the above rounding effect and might not exactly match the
127 requested values by the user.
133 functions return 0, and the
135 function returns the expiration overrun count for the specified timer.
136 Otherwise, the functions return \-1, and set
138 to indicate the error.
142 .Fn timer_getoverrun ,
145 functions will fail if:
150 does not correspond to a valid timer id as returned by
152 or that timer id has been deleted by
158 function will fail if:
161 A nanosecond field in the
163 structure specified a value less than zero or greater than or equal to 10e9.
166 .Xr clock_gettime 2 ,
172 .\" LocalWords: gettime settime