File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / gen / usleep.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\"	@(#)@(#)usleep.3	6.3 (Berkeley) 5/15/86
.\"
.TH USLEEP 3  "May 15, 1986"
.UC 6
.SH NAME
usleep \- suspend execution for interval
.SH SYNOPSIS
.nf
.B usleep(useconds)
.B unsigned useconds;
.fi
.SH DESCRIPTION
The current process is suspended from execution for the number
of microseconds specified by the argument.
The actual suspension time may be an arbitrary amount longer
because of other activity in the system
or because of the time spent in processing the call.
.PP
The routine is implemented by setting an interval timer
and pausing until it occurs.
The previous state of this timer is saved and restored.
If the sleep time exceeds the time to the expiration of the
previous timer,
the process sleeps only until the signal would have occurred, and the
signal is sent a short time later.
.PP
This routine is implemented using 
.IR setitimer (2);
it requires eight system calls each time it is invoked.
A similar but less compatible function can be obtained with a single
.IR select (2);
it would not restart after signals, but would not interfere
with other uses of
.IR setitimer . 
.SH "SEE ALSO"
setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), alarm(3)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.