Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <sys/types.h>
2
#include <sys/stat.h>
3
#include <fcntl.h>
4
#include <time.h>
5
#include <unistd.h>
6
#include <string.h>
7
#include <stdlib.h>
8
#include "sys9.h"
9
 
10
time_t
11
time(time_t *tp)
12
{
13
	char b[20];
14
	int f;
15
	time_t t;
16
 
17
	memset(b, 0, sizeof(b));
18
	f = _OPEN("/dev/time", 0);
19
	if(f >= 0) {
20
		_PREAD(f, b, sizeof(b), 0);
21
		_CLOSE(f);
22
	}
23
	t = atol(b);
24
	if(tp)
25
		*tp = t;
26
	return t;
27
}