* tui/tui.c (tui_rl_command_key): Switch to TUI_ONE_COMMAND_MODE
[deliverable/binutils-gdb.git] / libiberty / gettimeofday.c
CommitLineData
8ec32723
DD
1#include "config.h"
2#include "libiberty.h"
3#ifdef HAVE_TIME_H
4#include <time.h>
5#endif
6#ifdef HAVE_SYS_TIME_H
7#include <sys/time.h>
8#endif
9
10/*
11
0e867e79 12@deftypefn Supplemental int gettimeofday (struct timeval *@var{tp}, void *@var{tz})
8ec32723
DD
13
14Writes the current time to @var{tp}. This implementation requires
15that @var{tz} be NULL. Returns 0 on success, -1 on failure.
16
17@end deftypefn
18
19*/
20
21int
49b1fae4 22gettimeofday (struct timeval *tp, void *tz)
8ec32723
DD
23{
24 if (tz)
25 abort ();
26 tp->tv_usec = 0;
27 if (time (&tp->tv_sec) == (time_t) -1)
28 return -1;
29 return 0;
30}
This page took 0.296927 seconds and 4 git commands to generate.