xref: /illumos-gate/usr/src/man/man3c/ualarm.3c (revision e2f4f3dab373b605b62ac175115f264a5c417eb6)
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.
27When the
28.Fa interval
29argument is
30non-zero, repeated timeout notification occurs with a period in microseconds
31specified by the
32.Fa interval
33argument.
34If the notification signal,
35.Dv SIGALRM ,
36is not caught or ignored, the calling process is terminated.
37.Lp
38Because of scheduling delays, resumption of execution when the signal is caught
39may be delayed an arbitrary amount of time.
40.Lp
41Interactions between
42.Fn ualarm
43and either
44.Xr alarm 2
45or
46.Xr sleep 3C
47are unspecified.
48.Sh RETURN VALUES
49The
50.Fn ualarm
51function returns the number of microseconds remaining from
52the previous
53.Fn ualarm
54call.
55If no timeouts are pending or if
56.Fn ualarm
57has not previously been called,
58.Fn ualarm
59returns 0.
60.Sh ERRORS
61No errors are defined.
62.Sh USAGE
63The
64.Fn ualarm
65function is a simplified interface to
66.Xr setitimer 2 ,
67and uses the
68.Dv ITIMER_REAL
69interval timer.
70It's use has been deprecated in favor of the
71.Xr timer_create 3C
72family of functions.
73.Sh INTERFACE STABILITY
74.Sy Obsolete Standard .
75.Sh SEE ALSO
76.Xr alarm 2 ,
77.Xr setitimer 2 ,
78.Xr sighold 3C ,
79.Xr signal 3C ,
80.Xr sleep 3C ,
81.Xr timer_create 3C ,
82.Xr usleep 3C ,
83.Xr unistd.h 3HEAD ,
84.Xr standards 5
85.Sh STANDARDS
86The
87.Fn ualarm
88function is available in the following compilation environments.
89See
90.Xr standards 5 .
91.Lp
92.Bl -bullet -compact
93.\".It
94.\".St -p1003.1-90
95.\".It
96.\".St -p1003.1b-93
97.\".It
98.\".St -p1003.1c-95
99.\".It
100.\".St -p1003.1-2001
101.\".It
102.\".St -xpg3
103.\".It
104.\".St -xpg4
105.It
106.St -xpg4.2
107.It
108.St -susv2
109.It
110.St -susv3
111.El
112.Lp
113It is marked obsolete in
114.St -susv3 , and was removed from
115.St -p1003.1-2008 .
116