You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <linux/sched.h>
|
|
#include <unistd.h>
|
|
#include <linux/kernel.h>
|
|
#include <time.h>
|
|
|
|
int sys_sleep(unsigned int seconds)
|
|
{
|
|
long t = CURRENT_TIME;
|
|
current->state = TASK_INTERRUPTIBLE;
|
|
while(CURRENT - t < seconds){}
|
|
current->state = TASK_RUNNING;
|
|
return 0;
|
|
}
|