]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ualarm.3
Formatted signal names
[thirdparty/man-pages.git] / man3 / ualarm.3
CommitLineData
fea681da
MK
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
25ualarm \- schedule signal after given number of microseconds
26.SH SYNOPSIS
27.nf
e2ba4f8e 28.B "#define _XOPEN_SOURCE 500 /* Or: #define _BSD_SOURCE */"
fea681da
MK
29.B "#include <unistd.h>"
30.sp
31.BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
32.fi
33.SH DESCRIPTION
60a90ecd
MK
34The
35.BR ualarm ()
8bd58774
MK
36function causes the signal
37.B SIGALRM
38to be sent to the invoking process after (not less than)
fea681da
MK
39.I usecs
40microseconds.
41The delay may be lengthened slightly by any system activity
42or by the time spent processing the call or by the
43granularity of system timers.
44.LP
8bd58774
MK
45Unless caught or ignored, the
46.B SIGALRM
47signal will terminate the process.
fea681da
MK
48.LP
49If the
50.I interval
8bd58774
MK
51argument is non-zero, further
52.B SIGALRM
53signals will be sent every
fea681da
MK
54.I interval
55microseconds after the first.
56.SH "RETURN VALUE"
f42373f6
MK
57This function returns the number of microseconds remaining for
58any alarm that was previously set, or 0 if no alarm was pending.
fea681da
MK
59.SH ERRORS
60.TP
61EINTR
62Interrupted by a signal.
63.TP
64EINVAL
65\fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
66(On systems where that is considered an error.)
67.SH "CONFORMING TO"
c13182ef 684.3BSD, POSIX.1-2001.
f42373f6
MK
69POSIX.1-2001 marks
70.BR ualarm ()
71as obsolete.
724.3BSD, SUSv2, and POSIX do not define any errors.
fea681da
MK
73.SH NOTES
74The type
f42373f6 75.I useconds_t
fea681da
MK
76is an unsigned integer type capable of holding integers
77in the range [0,1000000].
f42373f6 78On the original BSD implementation, and in glibc before version 2.1,
c13182ef 79the arguments to
f42373f6
MK
80.BR ualarm ()
81were instead typed as
82.IR "unsigned int" .
c13182ef 83Programs will be more portable if they never mention
f42373f6
MK
84.I useconds_t
85explicitly.
fea681da
MK
86.LP
87The interaction of this function with
88other timer functions such as
1272ab18 89.BR alarm (2),
fb186734
MK
90.BR sleep (3),
91.BR nanosleep (2),
92.BR setitimer (2),
93.BR timer_create (3),
94.BR timer_delete (3),
95.BR timer_getoverrun (3),
96.BR timer_gettime (3),
97.BR timer_settime (3),
98.BR usleep (3)
fea681da
MK
99is unspecified.
100.LP
c13182ef
MK
101This function is obsolete.
102Use
fea681da 103.BR setitimer (2)
f42373f6 104or POSIX interval timers
fb186734 105.RB ( timer_create (3),
f42373f6 106etc.)
fea681da
MK
107instead.
108.SH "SEE ALSO"
109.BR alarm (2),
110.BR getitimer (2),
111.BR nanosleep (2),
112.BR select (2),
113.BR setitimer (2),
50e5322c 114.BR usleep (3),
60bb61aa
MK
115.BR feature_test_macros (7),
116.BR time (7)