Commit | Line | Data |
---|---|---|
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 | |
23 | The | |
24 | .Fn time | |
25 | function | |
af9bf3ab KB |
26 | returns the value of time in seconds since 0 hours, 0 minutes, |
27 | 0 seconds, January 1, 1970, Coordinated Universal Time. | |
ae59e04c CL |
28 | .Pp |
29 | A copy of the time value may be saved to the area indicated by the | |
30 | pointer | |
31 | .Fa tloc . | |
af9bf3ab | 32 | If |
ae59e04c | 33 | .Fa tloc |
af9bf3ab | 34 | is a NULL pointer, no value is stored. |
ae59e04c | 35 | .Pp |
af9bf3ab | 36 | Upon successful completion, |
ae59e04c | 37 | .Fn time |
af9bf3ab | 38 | returns the value of time. |
ae59e04c CL |
39 | Otherwise a value of |
40 | .Po | |
41 | .Po Fa time_t Pc \-1 | |
42 | .Pc | |
43 | is returned and the global variable | |
44 | .Va errno | |
af9bf3ab | 45 | is set to indicate the error. |
ae59e04c | 46 | .Sh ERRORS |
af9bf3ab | 47 | The following error codes may be set in |
ae59e04c CL |
48 | .Va errno : |
49 | .Bl -tag -width [EFAULT] | |
50 | .It Bq Er EFAULT | |
af9bf3ab | 51 | An argument address referenced invalid memory. |
ae59e04c CL |
52 | .Sh SEE ALSO |
53 | .Xr gettimeofday 2 , | |
54 | .Xr ctime 3 | |
55 | .Sh HISTORY | |
56 | A | |
57 | .Fn time | |
58 | function appeared in | |
59 | .At v6 . |