]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ualarm.3
Updated CONFORMING TO section
[thirdparty/man-pages.git] / man3 / ualarm.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
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.
7 .\"
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.
12 .\"
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.
17 .\"
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,
21 .\" USA.
22 .\"
23 .TH UALARM 3 2003-07-24 "" "Linux Programmer's Manual"
24 .SH NAME
25 ualarm \- schedule signal after given number of microseconds
26 .SH SYNOPSIS
27 .nf
28 /* BSD version */
29 .B "#include <unistd.h>"
30 .sp
31 .BI "unsigned int ualarm(unsigned int " usecs ", unsigned int " interval );
32 .sp
33 /* SUSv2 version */
34 .B "#define _XOPEN_SOURCE 500"
35 .br
36 .B "#include <unistd.h>"
37 .sp
38 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
39 .fi
40 .SH DESCRIPTION
41 The \fBualarm\fP() function causes the signal SIGALRM to be sent
42 to the invoking process after (not less than)
43 .I usecs
44 microseconds.
45 The delay may be lengthened slightly by any system activity
46 or by the time spent processing the call or by the
47 granularity of system timers.
48 .LP
49 Unless caught or ignored, this signal will terminate the process.
50 .LP
51 If the
52 .I interval
53 argument is non-zero, further SIGALRM signals will be sent every
54 .I interval
55 microseconds after the first.
56 .SH "RETURN VALUE"
57 This function returns the number of microseconds remaining from
58 the previous call, or 0 when no alarm is pending.
59 .SH ERRORS
60 .TP
61 EINTR
62 Interrupted by a signal.
63 .TP
64 EINVAL
65 \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
66 (On systems where that is considered an error.)
67 .SH "CONFORMING TO"
68 4.3BSD, POSIX.1-2001.
69 4.3BSD, SUSv2 and POSIX do not define any errors.
70 .SH NOTES
71 The type
72 .B useconds_t
73 is an unsigned integer type capable of holding integers
74 in the range [0,1000000].
75 This type is defined by
76 .I <sys/types.h>
77 included by
78 .I <unistd.h>
79 but glibc defines it only when _XOPEN_SOURCE has a value not less than 500,
80 or both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are defined.
81 .\" useconds_t also gives problems on HP-UX 10.
82 Programs will be more portable if they never mention this type explicitly.
83 .LP
84 The interaction of this function with
85 other timer functions such as
86 .BR alarm (),
87 .BR sleep (),
88 .BR nanosleep (),
89 .BR setitimer (),
90 .BR timer_create (),
91 .BR timer_delete (),
92 .BR timer_getoverrun (),
93 .BR timer_gettime (),
94 .BR timer_settime (),
95 .BR usleep ()
96 is unspecified.
97 .LP
98 This function is obsolete. Use
99 .BR nanosleep (2)
100 or
101 .BR setitimer (2)
102 instead.
103 .SH "SEE ALSO"
104 .BR alarm (2),
105 .BR getitimer (2),
106 .BR nanosleep (2),
107 .BR select (2),
108 .BR setitimer (2),
109 .BR usleep (3),
110 .BR feature_test_macros (7)