xref: /titanic_50/usr/src/man/man3c/ualarm.3c (revision c0dbe950192897247de6003f2dea1ca3c466fe01)
1.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2.\"  Copyright (c) 1980 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved  Portions Copyright (c) 1992,
3.\" X/Open Company Limited  All Rights Reserved
4.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5.\" http://www.opengroup.org/bookstore/.
6.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7.\"  This notice shall appear on any product containing this material.
8.Dd "Aug 16, 2014"
9.Dt UALARM 3C
10.Os
11.Sh NAME
12.Nm ualarm
13.Nd schedule signal after interval in microseconds
14.Sh SYNOPSIS
15.In unistd.h
16.Ft useconds_t
17.Fn ualarm "useconds_t useconds" "useconds_t interval"
18.Sh DESCRIPTION
19The
20.Fn ualarm
21function causes the
22.Dv SIGALRM
23signal to be generated for
24the calling process after the number of real-time microseconds specified by the
25.Fa useconds
26argument has elapsed.  When the
27.Fa interval
28argument is
29non-zero, repeated timeout notification occurs with a period in microseconds
30specified by the \fIinterval\fR argument. If the notification signal,
31.Dv SIGALRM ,
32is not caught or ignored, the calling process is terminated.
33.Lp
34Because of scheduling delays, resumption of execution when the signal is caught
35may be delayed an arbitrary amount of time.
36.Lp
37Interactions between
38.Fn ualarm
39and either
40.Xr alarm 2
41or
42.Xr sleep 3C
43are unspecified.
44.Sh RETURN VALUES
45The
46.Fn ualarm
47function returns the number of microseconds remaining from
48the previous
49.Fn ualarm
50call.  If no timeouts are pending or if
51.Fn ualarm
52has not previously been called,
53.Fn ualarm
54returns 0.
55.Sh ERRORS
56No errors are defined.
57.Sh USAGE
58The
59.Fn ualarm
60function is a simplified interface to
61.Xr setitimer 2 ,
62and uses the
63.Dv ITIMER_REAL
64interval timer. It's use has been deprecated in favor of the
65.Xr timer_create 3C
66family of functions.
67.Sh INTERFACE STABILITY
68.Sy Obsolete Standard .
69.Sh SEE ALSO
70.Xr alarm 2 ,
71.Xr setitimer 2 ,
72.Xr sighold 3C ,
73.Xr signal 3C ,
74.Xr sleep 3C ,
75.Xr timer_create 3C ,
76.Xr usleep 3C ,
77.Xr unistd.h 3HEAD ,
78.Xr standards 5
79.Sh STANDARDS
80The
81.Fn ualarm
82function is available in the following compilation environments.  See
83.Xr standards 5 .
84.Lp
85.Bl -bullet -compact
86.\".It
87.\".St -p1003.1-90
88.\".It
89.\".St -p1003.1b-93
90.\".It
91.\".St -p1003.1c-95
92.\".It
93.\".St -p1003.1-2001
94.\".It
95.\".St -xpg3
96.\".It
97.\".St -xpg4
98.It
99.St -xpg4.2
100.It
101.St -susv2
102.It
103.St -susv3
104.El
105.Lp
106It is marked obsolete in
107.St -susv3 , and was removed from
108.St -p1003.1-2008 .
109