macro and text revision (-mdoc version 3)
[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.\"
91cff1e1 4.\" %sccs.include.redist.man%
af9bf3ab 5.\"
ae59e04c 6.\" @(#)time.3 5.3 (Berkeley) %G%
af9bf3ab 7.\"
ae59e04c
CL
8.Dd
9.Dt TIME 3
10.Os BSD 4
11.Sh NAME
12.Nm time
13.Nd get time of day
14.Sh SYNOPSIS
15.Fd #include <sys/types.h>
16.Ft time_t
17.Fn time "time_t *tloc"
18.Sh DESCRIPTION
19The
20.Fn time
21function
af9bf3ab
KB
22returns the value of time in seconds since 0 hours, 0 minutes,
230 seconds, January 1, 1970, Coordinated Universal Time.
ae59e04c
CL
24.Pp
25A copy of the time value may be saved to the area indicated by the
26pointer
27.Fa tloc .
af9bf3ab 28If
ae59e04c 29.Fa tloc
af9bf3ab 30is a NULL pointer, no value is stored.
ae59e04c 31.Pp
af9bf3ab 32Upon successful completion,
ae59e04c 33.Fn time
af9bf3ab 34returns the value of time.
ae59e04c
CL
35Otherwise a value of
36.Po
37.Po Fa time_t Pc \-1
38.Pc
39is returned and the global variable
40.Va errno
af9bf3ab 41is set to indicate the error.
ae59e04c 42.Sh ERRORS
af9bf3ab 43The following error codes may be set in
ae59e04c
CL
44.Va errno :
45.Bl -tag -width [EFAULT]
46.It Bq Er EFAULT
af9bf3ab 47An argument address referenced invalid memory.
ae59e04c
CL
48.Sh SEE ALSO
49.Xr gettimeofday 2 ,
50.Xr ctime 3
51.Sh HISTORY
52A
53.Fn time
54function appeared in
55.At v6 .