summaryrefslogtreecommitdiff
path: root/src/time/time.c
blob: d6f4ba7ff4e7b50c8c59c2bae4e51076e44247c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <time.h>
#include <errno.h>
#include "_syscall.h"

/** get current time **/

time_t time(time_t * timer)
{
	long int now;
	SYSCALL_NUMBER(sc, time, 0);

	now = __syscall(sc);

	if (timer != NULL && now != -1) {
		*timer = (time_t)now;
	}

	return (time_t)now;
}

/***
gets the current time. If ARGUMENT(timer) is not CONSTANT(NULL),
the current time is also stored in the object it points to.
***/

/*
UNSPECIFIED(The encoding of TYPEDEF(time_t))
RETURN_FAILURE(CAST(TYPEDEF(time_t), -1))
RETURN_SUCCESS(the current calndar time)
STDC(1)
*/