X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/1c15e88899094343f75aeba04122cd96a96b428e..ad7871609881e73855d0b04da49b486cd93efca7:/usr/src/lib/libc/gen/time.3 diff --git a/usr/src/lib/libc/gen/time.3 b/usr/src/lib/libc/gen/time.3 index fa58de5fbc..1343836d76 100644 --- a/usr/src/lib/libc/gen/time.3 +++ b/usr/src/lib/libc/gen/time.3 @@ -1,58 +1,85 @@ -.\" Copyright (c) 1989 The Regents of the University of California. -.\" All rights reserved. +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. .\" -.\" Redistribution and use in source and binary forms are permitted provided -.\" that: (1) source distributions retain this entire copyright notice and -.\" comment, and (2) distributions including binaries display the following -.\" acknowledgement: ``This product includes software developed by the -.\" University of California, Berkeley and its contributors'' in the -.\" documentation or other materials provided with the distribution and in -.\" all advertising materials mentioning features or use of this software. -.\" Neither the name of the University nor the names of its contributors may -.\" be used to endorse or promote products derived from this software without -.\" specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" This code is derived from software contributed to Berkeley by +.\" the American National Standards Committee X3, on Information +.\" Processing Systems. .\" -.\" @(#)time.3 5.2 (Berkeley) 6/23/90 +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. .\" -.TH TIME 3 "June 23, 1990" -.UC 4 -.SH NAME -time \- get time of day -.SH SYNOPSIS -.nf -.B #include - -.B time_t time(tloc) -.B time_t *tloc; -.fi -.SH DESCRIPTION -.PP -.I Time +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)time.3 8.1 (Berkeley) 6/4/93 +.\" +.Dd June 4, 1993 +.Dt TIME 3 +.Os BSD 4 +.Sh NAME +.Nm time +.Nd get time of day +.Sh SYNOPSIS +.Fd #include +.Ft time_t +.Fn time "time_t *tloc" +.Sh DESCRIPTION +The +.Fn time +function returns the value of time in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time. -.PP -The argument -.I tloc -points to an area where the return value is also stored. +.Pp +A copy of the time value may be saved to the area indicated by the +pointer +.Fa tloc . If -.I tloc +.Fa tloc is a NULL pointer, no value is stored. -.PP +.Pp Upon successful completion, -.IR time () +.Fn time returns the value of time. -Otherwise a value of ((\fItime_t\fR) -1) -is returned and -.I errno +Otherwise a value of +.Po +.Po Fa time_t Pc \-1 +.Pc +is returned and the global variable +.Va errno is set to indicate the error. -.SH "ERRORS +.Sh ERRORS The following error codes may be set in -.IR errno : -.TP 15 -[EFAULT] +.Va errno : +.Bl -tag -width [EFAULT] +.It Bq Er EFAULT An argument address referenced invalid memory. -.SH "SEE ALSO" -gettimeofday(2), ctime(3) +.Sh SEE ALSO +.Xr gettimeofday 2 , +.Xr ctime 3 +.Sh HISTORY +A +.Fn time +function appeared in +.At v6 .