xref: /csrg-svn/lib/libc/gen/time.3 (revision 50333)
148352Scael.\" Copyright (c) 1989, 1991 The Regents of the University of California.
238049Sbostic.\" All rights reserved.
338049Sbostic.\"
4*50333Sbostic.\" This code is derived from software contributed to Berkeley by
5*50333Sbostic.\" the American National Standards Committee X3, on Information
6*50333Sbostic.\" Processing Systems.
7*50333Sbostic.\"
843571Strent.\" %sccs.include.redist.man%
938049Sbostic.\"
10*50333Sbostic.\"     @(#)time.3	5.4 (Berkeley) 06/29/91
1138049Sbostic.\"
1248352Scael.Dd
1348352Scael.Dt TIME 3
1448352Scael.Os BSD 4
1548352Scael.Sh NAME
1648352Scael.Nm time
1748352Scael.Nd get time of day
1848352Scael.Sh SYNOPSIS
1948352Scael.Fd #include <sys/types.h>
2048352Scael.Ft time_t
2148352Scael.Fn time "time_t *tloc"
2248352Scael.Sh DESCRIPTION
2348352ScaelThe
2448352Scael.Fn time
2548352Scaelfunction
2638049Sbosticreturns the value of time in seconds since 0 hours, 0 minutes,
2738049Sbostic0 seconds, January 1, 1970, Coordinated Universal Time.
2848352Scael.Pp
2948352ScaelA copy of the time value may be saved to the area indicated by the
3048352Scaelpointer
3148352Scael.Fa tloc .
3238049SbosticIf
3348352Scael.Fa tloc
3438049Sbosticis a NULL pointer, no value is stored.
3548352Scael.Pp
3638049SbosticUpon successful completion,
3748352Scael.Fn time
3838049Sbosticreturns the value of time.
3948352ScaelOtherwise a value of
4048352Scael.Po
4148352Scael.Po Fa time_t Pc \-1
4248352Scael.Pc
4348352Scaelis returned and the global variable
4448352Scael.Va errno
4538049Sbosticis set to indicate the error.
4648352Scael.Sh ERRORS
4738049SbosticThe following error codes may be set in
4848352Scael.Va errno :
4948352Scael.Bl -tag -width [EFAULT]
5048352Scael.It Bq Er EFAULT
5138049SbosticAn argument address referenced invalid memory.
5248352Scael.Sh SEE ALSO
5348352Scael.Xr gettimeofday 2 ,
5448352Scael.Xr ctime 3
5548352Scael.Sh HISTORY
5648352ScaelA
5748352Scael.Fn time
5848352Scaelfunction appeared in
5948352Scael.At v6 .
60