1 /* Reentrant version of gettimeofday system call
2 This implementation just calls the times/gettimeofday system calls.
3 Gettimeofday may not be available on all targets. It's presence
4 here is dubious. Consider it for internal use only. */
12 /* Some targets provides their own versions of these functions. Those
13 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
16 #ifndef REENTRANT_SYSCALLS_PROVIDED
17 #define REENTRANT_SYSCALLS_PROVIDED
21 #ifdef REENTRANT_SYSCALLS_PROVIDED
23 int _dummy_gettimeofday_syscalls
= 1;
27 /* We use the errno variable used by the system dependent layer. */
33 <<_gettimeofday_r>>---Reentrant version of gettimeofday
41 int _gettimeofday_r(struct _reent *<[ptr]>,
42 struct timeval *<[ptimeval]>,
46 This is a reentrant version of <<gettimeofday>>. It
47 takes a pointer to the global data block, which holds
50 This function is only available for a few targets.
51 Check libc.a to see if its available on yours.
55 _gettimeofday_r (struct _reent
*ptr
,
56 struct timeval
*ptimeval
,
62 if ((ret
= _gettimeofday (ptimeval
, ptimezone
)) == -1 && errno
!= 0)
63 _REENT_ERRNO(ptr
) = errno
;
67 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */