* Return the current time expressed as seconds from 00:00:00 UTC, 1 Jan 1970. * * @param tp When not NULL, set this to the current time in seconds. * @return The current time in seconds. */
| 130 | * @return The current time in seconds. |
| 131 | */ |
| 132 | time_t time(time_t *tp) |
| 133 | { |
| 134 | /* |
| 135 | * Call the gtod init when we need it - this keeps the code from |
| 136 | * being included in the binary if we don't need it. |
| 137 | */ |
| 138 | if (!clock.ticks) |
| 139 | gettimeofday_init(); |
| 140 | |
| 141 | update_clock(); |
| 142 | |
| 143 | if (tp) |
| 144 | *tp = clock.secs; |
| 145 | |
| 146 | return clock.secs; |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * Return the current time broken into a timeval structure. |