.\" Copyright (c) 2008, Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH CLOCK_NANOSLEEP 2 2010-12-03 "Linux" "Linux Programmer's Manual"
+.TH CLOCK_NANOSLEEP 2 2014-12-31 "Linux" "Linux Programmer's Manual"
.SH NAME
clock_nanosleep \- high-resolution sleep with specifiable clock
.SH SYNOPSIS
.BI " struct timespec *" remain );
.fi
.sp
-Link with \fI\-lrt\fP.
+Link with \fI\-lrt\fP (only for glibc versions before 2.17).
.sp
.ad l
.in -4n
See
.BR clock_getres (2)
for further details on these clocks.
+In addition, the CPU clock IDs returned by
+.BR clock_getcpuclockid (3)
+and
+.BR pthread_getcpuclockid (3)
+can also be passed in
+.IR clock_id .
If
.I flags
This value can then be used to call
.BR clock_nanosleep ()
again and complete a (relative) sleep.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On successfully sleeping for the requested interval,
.BR clock_nanosleep ()
returns 0.
.BR clock_nanosleep ()
system call first appeared in Linux 2.6.
Support is available in glibc since version 2.1.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
POSIX.1-2001.
.SH NOTES
If the interval specified in
is never restarted after being interrupted by a signal handler,
regardless of the use of the
.BR sigaction (2)
-.B SA_SIGACTION
+.B SA_RESTART
flag.
The
.BR clock_settime (2)
shall have no effect on a thread that is blocked on a relative
.BR clock_nanosleep ().
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR clock_getres (2),
.BR nanosleep (2),
+.BR restart_syscall (2),
.BR timer_create (2),
.BR sleep (3),
.BR usleep (3),
.BR time (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.