1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .TH UALARM 3 2013-12-23 "" "Linux Programmer's Manual"
26 ualarm \- schedule signal after given number of microseconds
29 .B "#include <unistd.h>"
31 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
35 Feature Test Macro Requirements for glibc (see
36 .BR feature_test_macros (7)):
47 (_XOPEN_SOURCE\ >=\ 500 ||
48 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
49 !(_POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700)
53 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
54 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
61 function causes the signal
63 to be sent to the invoking process after (not less than)
66 The delay may be lengthened slightly by any system activity
67 or by the time spent processing the call or by the
68 granularity of system timers.
70 Unless caught or ignored, the
72 signal will terminate the process.
76 argument is nonzero, further
78 signals will be sent every
80 microseconds after the first.
82 This function returns the number of microseconds remaining for
83 any alarm that was previously set, or 0 if no alarm was pending.
87 Interrupted by a signal.
90 \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
91 (On systems where that is considered an error.)
93 .SS Multithreading (see pthreads(7))
96 function is thread-safe.
102 POSIX.1-2008 removes the specification of
104 4.3BSD, SUSv2, and POSIX do not define any errors.
106 POSIX.1-2001 does not specify what happens if the
109 .\" This case is not documented in HP-US, Solar, FreeBSD, NetBSD, or OpenBSD!
110 On Linux (and probably most other systems),
111 the effect is to cancel any pending alarm.
115 is an unsigned integer type capable of holding integers
116 in the range [0,1000000].
117 On the original BSD implementation, and in glibc before version 2.1,
120 were instead typed as
122 Programs will be more portable if they never mention
126 The interaction of this function with
127 other timer functions such as
132 .BR timer_create (2),
133 .BR timer_delete (2),
134 .BR timer_getoverrun (2),
135 .BR timer_gettime (2),
136 .BR timer_settime (2),
140 This function is obsolete.
143 or POSIX interval timers
144 .RB ( timer_create (2),