source: trunk/minix/man/man2/time.2@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.4 KB
Line 
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)gettimeofday.2 6.7 (Berkeley) 5/14/86
6.\"
7.TH TIME 2 "May 14, 1986"
8.UC 4
9.SH NAME
10time, stime \- get/set date and time
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/types.h>
15#include <time.h>
16
17time_t time(time_t *\fItp\fP)
18int stime(time_t *\fItp\fP)
19.fi
20.SH DESCRIPTION
21The system's notion of the current Greenwich time
22is obtained with the
23.B time
24call, and set with the
25.B stime
26call.
27The time is expressed
28in seconds since midnight (0 hour), January 1, 1970.
29The time is both returned by
30.B time
31and stored in the variable pointed to by
32.I tp
33unless
34.I tp
35is the null pointer.
36.PP
37.B Stime
38obtains the time to set from the variable pointed to by
39.IR tp .
40.PP
41Only the super-user may set the time of day.
42.SH RETURN
43A 0 return value from
44.B stime
45indicates that the call succeeded.
46.B Time
47returns the current time on success.
48A \-1 return value indicates an error occurred, and in this
49case an error code is stored into the global variable \fBerrno\fP.
50.SH "ERRORS
51The following error codes may be set in \fBerrno\fP:
52.TP 15
53[EFAULT]
54The
55.I tp
56address referenced invalid memory.
57.TP 15
58[EPERM]
59A user other than the super-user attempted to set the time.
60.SH "SEE ALSO"
61.BR date (1),
62.BR ctime (3).
Note: See TracBrowser for help on using the repository browser.