Skip to content

Instantly share code, notes, and snippets.

Avatar

Dmitry Holodov dimalinux

View GitHub Profile
@dimalinux
dimalinux / futexsleep.c
Created Mar 2, 2018
Using futex syscall to implement sleep
View futexsleep.c
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/futex.h>
int
futex_sleep (time_t seconds, long nanoseconds)
{