libdill: Structured Concurrency for C

NAME

msleep - waits until deadline expires

SYNOPSIS

#include <libdill.h>

int msleep(int64_t deadline);

DESCRIPTION

deadline is a point in time when the operation should finish. Use the now function to get your current point in time. 0 will cause the function to return without blocking. -1 will cause it to block forever.

RETURN VALUE

Returns 0 on success. One error, -1 is returned and errno is set to one of the values below.

ERRORS

EXAMPLE

int result = msleep(now() + 1000);
if(result != 0) {
    perror("Cannot sleep");
    exit(1);
}
printf("Slept succefully for 1 second.\n");