]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ualarm.3
Change itacised function names and page xrefs to bold
[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"
32 .br
33 .BI "ualarm(unsigned int " usecs ", unsigned int " interval );
34 .sp
35 /* SUSv2 version */
36 .B "#define _XOPEN_SOURCE 500"
37 .br
38 .B "#include <unistd.h>"
39 .sp
40 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
41 .fi
42 .SH DESCRIPTION
43 The \fBualarm\fP() function causes the signal SIGALRM to be sent
44 to the invoking process after (not less than)
45 .I usecs
46 microseconds.
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.
50 .LP
51 Unless caught or ignored, this signal will terminate the process.
52 .LP
53 If the
54 .I interval
55 argument is non-zero, further SIGALRM signals will be sent every
56 .I interval
57 microseconds after the first.
58 .SH "RETURN VALUE"
59 This function returns the number of microseconds remaining from
60 the previous call, or 0 when no alarm is pending.
61 .SH ERRORS
62 .TP
63 EINTR
64 Interrupted by a signal.
65 .TP
66 EINVAL
67 \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
68 (On systems where that is considered an error.)
69 .SH "CONFORMING TO"
70 4.3BSD, POSIX 1003.1-2003.
71 4.3BSD, SUSv2 and POSIX do not define any errors.
72 .SH NOTES
73 The type
74 .B useconds_t
75 is an unsigned integer type capable of holding integers
76 in the range [0,1000000].
77 This type is defined by
78 .I <sys/types.h>
79 included by
80 .I <unistd.h>
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.
85 .LP
86 The interaction of this function with
87 other timer functions such as
88 .BR alarm (),
89 .BR sleep (),
90 .BR nanosleep (),
91 .BR setitimer (),
92 .BR timer_create (),
93 .BR timer_delete (),
94 .BR timer_getoverrun (),
95 .BR timer_gettime (),
96 .BR timer_settime (),
97 .BR usleep ()
98 is unspecified.
99 .LP
100 This function is obsolete. Use
101 .BR nanosleep (2)
102 or
103 .BR setitimer (2)
104 instead.
105 .SH "SEE ALSO"
106 .BR alarm (2),
107 .BR getitimer (2),
108 .BR nanosleep (2),
109 .BR select (2),
110 .BR setitimer (2),
111 .BR usleep (3)