Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / reent / timesr.c
blobbb890035a3196ae6f865fdbdbf65308da86176b0
1 /* Reentrant versions of times system calls */
3 #include <reent.h>
4 #include <time.h>
5 #include <sys/time.h>
6 #include <sys/times.h>
7 #include <_syslist.h>
9 /* Some targets provides their own versions of these functions. Those
10 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
12 #ifdef _REENT_ONLY
13 #ifndef REENTRANT_SYSCALLS_PROVIDED
14 #define REENTRANT_SYSCALLS_PROVIDED
15 #endif
16 #endif
18 #ifdef REENTRANT_SYSCALLS_PROVIDED
20 int _dummy_times_syscalls = 1;
22 #else
24 /* We use the errno variable used by the system dependent layer. */
25 #undef errno
26 extern int errno;
29 FUNCTION
30 <<_times_r>>---Reentrant version of times
32 INDEX
33 _times_r
35 SYNOPSIS
36 #include <reent.h>
37 #include <sys/times.h>
38 clock_t _times_r(struct _reent *<[ptr]>, struct tms *<[ptms]>);
40 DESCRIPTION
41 This is a reentrant version of <<times>>. It
42 takes a pointer to the global data block, which holds
43 <<errno>>.
46 clock_t
47 _times_r (struct _reent *ptr,
48 struct tms *ptms)
50 clock_t ret;
52 ret = _times (ptms);
53 return ret;
55 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */