Kris YotamImport st history35a43d22 months agoHistory
31 lines · 375 B · C
RawDownload
#include <time.h>struct timespec sutv; static voidtsync_begin(){	clock_gettime(CLOCK_MONOTONIC, &sutv);	su = 1;} static voidtsync_end(){	su = 0;} inttinsync(uint timeout){	struct timespec now;	if (su && !clock_gettime(CLOCK_MONOTONIC, &now)	       && TIMEDIFF(now, sutv) >= timeout)		su = 0;	return su;} intttyread_pending(){	return twrite_aborted;}