Skip to content

Instantly share code, notes, and snippets.

View dimalinux's full-sized avatar

Dmitry Holodov dimalinux

View GitHub Profile
@dimalinux
dimalinux / futexsleep.c
Created March 2, 2018 04:39
Using futex syscall to implement sleep
#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)
{