OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / 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  2008-08-06 "" "Linux Programmer's Manual"
24 .SH NAME
25 ualarm \- schedule signal after given number of microseconds
26 .SH SYNOPSIS
27 .nf
28 .B "#include <unistd.h>"
29 .sp
30 .BI "useconds_t ualarm(useconds_t " usecs ", useconds_t " interval );
31 .fi
32 .sp
33 .in -4n
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
36 .in
37 .sp
38 .BR ualarm ():
39 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500
40 .SH DESCRIPTION
41 The
42 .BR ualarm ()
43 function causes the signal
44 .B SIGALRM
45 to be sent to the invoking process after (not less than)
46 .I usecs
47 microseconds.
48 The delay may be lengthened slightly by any system activity
49 or by the time spent processing the call or by the
50 granularity of system timers.
51 .LP
52 Unless caught or ignored, the
53 .B SIGALRM
54 signal will terminate the process.
55 .LP
56 If the
57 .I interval
58 argument is nonzero, further
59 .B SIGALRM
60 signals will be sent every
61 .I interval
62 microseconds after the first.
63 .SH "RETURN VALUE"
64 This function returns the number of microseconds remaining for
65 any alarm that was previously set, or 0 if no alarm was pending.
66 .SH ERRORS
67 .TP
68 .B EINTR
69 Interrupted by a signal.
70 .TP
71 .B EINVAL
72 \fIusecs\fP or \fIinterval\fP is not smaller than 1000000.
73 (On systems where that is considered an error.)
74 .SH "CONFORMING TO"
75 4.3BSD, POSIX.1-2001.
76 POSIX.1-2001 marks
77 .BR ualarm ()
78 as obsolete.
79 POSIX.1-2008 removes the specification of
80 .BR ualarm ().
81 4.3BSD, SUSv2, and POSIX do not define any errors.
82 .SH NOTES
83 The type
84 .I useconds_t
85 is an unsigned integer type capable of holding integers
86 in the range [0,1000000].
87 On the original BSD implementation, and in glibc before version 2.1,
88 the arguments to
89 .BR ualarm ()
90 were instead typed as
91 .IR "unsigned int" .
92 Programs will be more portable if they never mention
93 .I useconds_t
94 explicitly.
95 .LP
96 The interaction of this function with
97 other timer functions such as
98 .BR alarm (2),
99 .BR sleep (3),
100 .BR nanosleep (2),
101 .BR setitimer (2),
102 .BR timer_create (2),
103 .BR timer_delete (2),
104 .BR timer_getoverrun (2),
105 .BR timer_gettime (2),
106 .BR timer_settime (2),
107 .BR usleep (3)
108 is unspecified.
109 .LP
110 This function is obsolete.
111 Use
112 .BR setitimer (2)
113 or POSIX interval timers
114 .RB ( timer_create (2),
115 etc.)
116 instead.
117 .SH "SEE ALSO"
118 .BR alarm (2),
119 .BR getitimer (2),
120 .BR nanosleep (2),
121 .BR select (2),
122 .BR setitimer (2),
123 .BR usleep (3),
124 .BR time (7)