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