usleep(3) Library Functions Manual usleep(3) usleep - C (libc, -lc) #include int usleep(useconds_t usec); glibc (. feature_test_macros(7)): usleep(): glibc 2.12: (_XOPEN_SOURCE >= 500) && ! (_POSIX_C_SOURCE >= 200809L) || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE glibc 2.12: _BSD_SOURCE || _XOPEN_SOURCE >= 500 usleep() ( ) usec . , -, , - . The usleep() function returns 0 on success. On error, -1 is returned, with errno set to indicate the error. EINTR ; . signal(7). EINVAL usec 1000000 ( , ). attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |usleep() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ None. 4.3BSD, POSIX.1-2001. POSIX.1-2001 declares it obsolete, suggesting nanosleep(2) instead. Removed in POSIX.1-2008. On the original BSD implementation, and before glibc 2.2.2, the return type of this function is void. The POSIX version returns int, and this is also the prototype used since glibc 2.2.2. EINVAL SUSv2 POSIX.1-2001. CAVEATS SIGALRM , alarm(2), sleep(3), nanosleep(2), setitimer(2), timer_create(2), timer_delete(2), timer_getoverrun(2), timer_gettime(2), timer_settime(2), ualarm(3), . alarm(2), getitimer(2), nanosleep(2), select(2), setitimer(2), sleep(3), ualarm(3), useconds_t(3type), time(7) () Azamat Hackimov , Dmitriy Ovchinnikov , Dmitry Bolkhovskikh , Katrin Kutepova , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 2 2024 . usleep(3)