Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/sys/src/ape/lib/ap/plan9/_nap.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include "lib.h"
2
#include <unistd.h>
3
#include <time.h>
4
#include "sys9.h"
5
 
6
/*
7
 * This is an extension to POSIX
8
 */
9
unsigned int
10
_nap(unsigned int millisecs)
11
{
12
	time_t t0, t1;
13
 
14
	t0 = time(0);
15
	if(_SLEEP(millisecs) < 0){
16
		t1 = time(0);
17
		return t1-t0;
18
	}
19
	return 0;
20
}