#include<threads.h>#include<time.h>#include<errno.h>#include"syscall.h"intthrd_sleep(conststructtimespec*req,structtimespec*rem){intret=-__clock_nanosleep(CLOCK_REALTIME,0,req,rem);switch(ret){case0:return0;case-EINTR:return-1;/* value specified by C11 */default:return-2;}}