SLEEP(3) | Linux Programmer's Manual | SLEEP(3) |
sleep - 指定の秒数の間だけ休止する
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
sleep() causes the calling thread to sleep either until the number of real-time seconds specified in seconds have elapsed or until a signal arrives which is not ignored.
要求された時間が過ぎた場合はゼロを返す。 呼び出しがシグナルハンドラーに割り込まれた場合は、 休止の残り時間を返す。
この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース | 属性 | 値 |
sleep() | Thread safety | MT-Unsafe sig:SIGCHLD/linux |
POSIX.1-2001, POSIX.1-2008.
On Linux, sleep() is implemented via nanosleep(2). See the nanosleep(2) man page for a discussion of the clock used.
On some systems, sleep() may be implemented using alarm(2) and SIGALRM (POSIX.1 permits this); mixing calls to alarm(2) and sleep() is a bad idea.
休止中にシグナルハンドラーから longjmp(3) を使用することや SIGALRM のハンドリングを変更することは、定義されていない結果を生む。
sleep(1), alarm(2), nanosleep(2), signal(2), signal(7)
この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。
2017-09-15 | GNU |