76 lines
1.6 KiB
Groff
76 lines
1.6 KiB
Groff
'\"macro stdmacro
|
|
.TH SGINAP 2
|
|
.SH NAME
|
|
.Op c p a
|
|
.B sginap
|
|
\- timed sleep and processor yield function
|
|
.Op
|
|
.Op f
|
|
.B sginap, sginap64
|
|
\- timed sleep and processor yield function
|
|
.Op
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
\f4#include <unistd.h>\f1
|
|
.br
|
|
.B "long sginap (long ticks);"
|
|
.Op
|
|
.Op f
|
|
.SH FORTRAN SYNOPSIS
|
|
.br
|
|
.B "integer *4 subroutine sginap (ticks)"
|
|
.br
|
|
.B "integer *4 ticks"
|
|
.sp
|
|
.B "integer *8 subroutine sginap64 (ticks64)"
|
|
.br
|
|
.B "integer *8 ticks64"
|
|
.Op
|
|
.SH DESCRIPTION
|
|
.PP
|
|
The
|
|
.I sginap
|
|
.Op f
|
|
and sginap64
|
|
.Op
|
|
system call provides two functions. With an argument of 0, it yields the
|
|
processor to any higher or equal priority threads immediately, thus
|
|
potentially allowing another thread to run. Note that because normally the user
|
|
has no direct control over the exact priority of a given thread, this
|
|
does not guarantee that another thread will run.
|
|
.PP
|
|
With an argument which is non-zero,
|
|
.I sginap
|
|
will suspend the thread for between
|
|
.BR ticks -1
|
|
and
|
|
.B ticks
|
|
clock ticks. That is, it will suspend for at least
|
|
.BR ticks -1
|
|
clock ticks, but less than
|
|
.B ticks
|
|
clock ticks. The length of a clock tick is defined by
|
|
.SM
|
|
.B CLK_TCK
|
|
in the include file
|
|
.I <limits.h>.
|
|
This is the same for all
|
|
.SM
|
|
.I SGI
|
|
systems.
|
|
.PP
|
|
Note that if the calling thread is interrupted by a signal before the
|
|
specified number of ticks has elapsed,
|
|
.I sginap
|
|
will return prematurely.
|
|
.SH "SEE ALSO"
|
|
sleep(3), alarm(2), pause(2), schedctl(2), setitimer(2).
|
|
.SH "DIAGNOSTICS"
|
|
.PP
|
|
If the calling thread remains suspended for the requested number of
|
|
ticks,
|
|
.I sginap
|
|
returns 0. If, however, the thread is interrupted prematurely
|
|
by a signal, it returns the number of unexpired ticks in the specified
|
|
period.
|