The pause() causes the calling process (or thread) to sleep until a signal is delivered that either terminates the process or cause the invocation of a signal-catching function.
#include <unistd.h>
int pause(void);
- return value
: returns -1, and errno is set to EINTR. only when a signal was caught and the signal-catching function returned.
The 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.
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
- return value
: 0 if the requested time has elapsed, or the number of seconds left to sleep, if the call was interrupted by a signal handler.
The usleep() function suspends execution of the calling thread for (at least) usec microseconds.
#include <unistd.h>
int usleep(useconds_t usec);
- return value
: returns 0 on success. On error, -1 is returned, with errno set to indicate the error.