__ goes away
[unix-history] / usr / src / lib / libc / gen / time.3
CommitLineData
ae59e04c 1.\" Copyright (c) 1989, 1991 The Regents of the University of California.
af9bf3ab
KB
2.\" All rights reserved.
3.\"
043368e6
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information
6.\" Processing Systems.
7.\"
91cff1e1 8.\" %sccs.include.redist.man%
af9bf3ab 9.\"
043368e6 10.\" @(#)time.3 5.4 (Berkeley) %G%
af9bf3ab 11.\"
ae59e04c
CL
12.Dd
13.Dt TIME 3
14.Os BSD 4
15.Sh NAME
16.Nm time
17.Nd get time of day
18.Sh SYNOPSIS
19.Fd #include <sys/types.h>
20.Ft time_t
21.Fn time "time_t *tloc"
22.Sh DESCRIPTION
23The
24.Fn time
25function
af9bf3ab
KB
26returns the value of time in seconds since 0 hours, 0 minutes,
270 seconds, January 1, 1970, Coordinated Universal Time.
ae59e04c
CL
28.Pp
29A copy of the time value may be saved to the area indicated by the
30pointer
31.Fa tloc .
af9bf3ab 32If
ae59e04c 33.Fa tloc
af9bf3ab 34is a NULL pointer, no value is stored.
ae59e04c 35.Pp
af9bf3ab 36Upon successful completion,
ae59e04c 37.Fn time
af9bf3ab 38returns the value of time.
ae59e04c
CL
39Otherwise a value of
40.Po
41.Po Fa time_t Pc \-1
42.Pc
43is returned and the global variable
44.Va errno
af9bf3ab 45is set to indicate the error.
ae59e04c 46.Sh ERRORS
af9bf3ab 47The following error codes may be set in
ae59e04c
CL
48.Va errno :
49.Bl -tag -width [EFAULT]
50.It Bq Er EFAULT
af9bf3ab 51An argument address referenced invalid memory.
ae59e04c
CL
52.Sh SEE ALSO
53.Xr gettimeofday 2 ,
54.Xr ctime 3
55.Sh HISTORY
56A
57.Fn time
58function appeared in
59.At v6 .