summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys')
-rw-r--r--newlib/libc/sys/linux/include/time.h22
-rw-r--r--newlib/libc/sys/linux/sys/_types.h52
-rw-r--r--newlib/libc/sys/linux/sys/types.h10
3 files changed, 71 insertions, 13 deletions
diff --git a/newlib/libc/sys/linux/include/time.h b/newlib/libc/sys/linux/include/time.h
index 2db33242e..8b4b28460 100644
--- a/newlib/libc/sys/linux/include/time.h
+++ b/newlib/libc/sys/linux/include/time.h
@@ -5,7 +5,6 @@
*/
#ifndef _TIME_H_
-#define _TIME_H_
#include "_ansi.h"
#include <sys/reent.h>
@@ -21,6 +20,20 @@ extern "C" {
/* Get _CLOCKS_PER_SEC_ */
#include <machine/time.h>
+#include <sys/types.h>
+
+/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC
+struct timespec {
+ time_t tv_sec; /* Seconds */
+ long tv_nsec; /* Nanoseconds */
+};
+#endif /* !_STRUCT_TIMESPEC */
+
+#ifndef __need_timespec
+
+#define _TIME_H_ 1
#ifndef _CLOCKS_PER_SEC_
#define _CLOCKS_PER_SEC_ 1000
@@ -31,8 +44,6 @@ extern "C" {
#define __need_size_t
#include <stddef.h>
-#include <sys/types.h>
-
struct tm
{
int tm_sec;
@@ -208,5 +219,10 @@ int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr));
#ifdef __cplusplus
}
#endif
+
+#endif /* ! __need_timespec */
+
+#undef __need_timespec
+
#endif /* _TIME_H_ */
diff --git a/newlib/libc/sys/linux/sys/_types.h b/newlib/libc/sys/linux/sys/_types.h
new file mode 100644
index 000000000..316012929
--- /dev/null
+++ b/newlib/libc/sys/linux/sys/_types.h
@@ -0,0 +1,52 @@
+/* ANSI C namespace clean utility typedefs */
+
+/* This file defines various typedefs needed by the system calls that support
+ the C library. Basically, they're just the POSIX versions with an '_'
+ prepended. This file lives in the `sys' directory so targets can provide
+ their own if desired (or they can put target dependant conditionals here).
+*/
+
+#ifndef _SYS__TYPES_H
+#define _SYS__TYPES_H
+
+typedef long _off_t;
+__extension__ typedef long long _off64_t;
+
+#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
+typedef int _ssize_t;
+#else
+typedef long _ssize_t;
+#endif
+
+#define __need_wint_t
+#include <stddef.h>
+
+#ifndef _MBSTATE_T
+#define _MBSTATE_T
+/* Conversion state information. */
+typedef struct
+{
+ int __count;
+ union
+ {
+ wint_t __wch;
+ char __wchb[4];
+ } __value; /* Value so far. */
+} _mbstate_t;
+#endif /* _MBSTATE_T */
+
+struct __flock_t_tmp;
+typedef struct
+{
+ int __a;
+ int __b;
+ struct
+ {
+ long int __c1;
+ int __c2;
+ } __c;
+ int __d;
+ struct __flock_t_tmp * __e;
+} _flock_t;
+
+#endif /* _SYS__TYPES_H */
diff --git a/newlib/libc/sys/linux/sys/types.h b/newlib/libc/sys/linux/sys/types.h
index 5541f09d1..90011ea83 100644
--- a/newlib/libc/sys/linux/sys/types.h
+++ b/newlib/libc/sys/linux/sys/types.h
@@ -94,16 +94,6 @@ typedef struct
typedef int clockid_t;
-/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
-
-#ifndef _STRUCT_TIMESPEC
-#define _STRUCT_TIMESPEC
-struct timespec {
- time_t tv_sec; /* Seconds */
- long tv_nsec; /* Nanoseconds */
-};
-#endif /* !_STRUCT_TIMESPEC */
-
# define _SYS_TYPES_FD_SET
# define NBBY 8 /* number of bits in a byte */
/*