1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .TH UALARM 3 2003-07-24 "" "Linux Programmer's Manual"
25 ualarm \- schedule signal after given number of microseconds
29 .B "#include <unistd.h>"
33 .BI "ualarm(unsigned int " usecs ", unsigned int " interval );
36 .B "#define _XOPEN_SOURCE 500"
38 .B "#include <unistd.h>"
40 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
43 The \fBualarm\fP() function causes the signal SIGALRM to be sent
44 to the invoking process after (not less than)
47 The delay may be lengthened slightly by any system activity
48 or by the time spent processing the call or by the
49 granularity of system timers.
51 Unless caught or ignored, this signal will terminate the process.
55 argument is non-zero, further SIGALRM signals will be sent every
57 microseconds after the first.
59 This function returns the number of microseconds remaining from
60 the previous call, or 0 when no alarm is pending.
64 Interrupted by a signal.
67 \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
68 (On systems where that is considered an error.)
70 4.3BSD, POSIX 1003.1-2003.
71 4.3BSD, SUSv2 and POSIX do not define any errors.
75 is an unsigned integer type capable of holding integers
76 in the range [0,1000000].
77 This type is defined by
81 but glibc defines it only when _XOPEN_SOURCE has a value not less than 500,
82 or both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are defined.
83 .\" useconds_t also gives problems on HPUX 10.
84 Programs will be more portable if they never mention this type explicitly.
86 The interaction of this function with
87 other timer functions such as
94 .BR timer_getoverrun (),
100 This function is obsolete. Use