1/* ANSI C namespace clean utility typedefs */
2
3/* This file defines various typedefs needed by the system calls that support
4   the C library.  Basically, they're just the POSIX versions with an '_'
5   prepended.  This file lives in the `sys' directory so targets can provide
6   their own if desired (or they can put target dependant conditionals here).
7*/
8
9#ifndef	_SYS__TYPES_H
10#define _SYS__TYPES_H
11
12#include <machine/_types.h>
13#include <sys/lock.h>
14
15#ifndef __off_t_defined
16typedef long _off_t;
17#endif
18
19#if defined(__rtems__)
20/* device numbers are 32-bit major and and 32-bit minor */
21typedef unsigned long long __dev_t;
22#else
23#ifndef __dev_t_defined
24typedef short __dev_t;
25#endif
26#endif
27
28#ifndef __uid_t_defined
29typedef unsigned short __uid_t;
30#endif
31#ifndef __gid_t_defined
32typedef unsigned short __gid_t;
33#endif
34
35#ifndef __off64_t_defined
36__extension__ typedef long long _off64_t;
37#endif
38
39/*
40 * We need fpos_t for the following, but it doesn't have a leading "_",
41 * so we use _fpos_t instead.
42 */
43#ifndef __fpos_t_defined
44typedef long _fpos_t;		/* XXX must match off_t in <sys/types.h> */
45				/* (and must be `long' for now) */
46#endif
47
48#ifdef __LARGE64_FILES
49#ifndef __fpos64_t_defined
50typedef _off64_t _fpos64_t;
51#endif
52#endif
53
54#ifndef __ssize_t_defined
55#ifdef __SIZE_TYPE__
56/* If __SIZE_TYPE__ is defined (gcc) we define ssize_t based on size_t.
57   We simply change "unsigned" to "signed" for this single definition
58   to make sure ssize_t and size_t only differ by their signedness. */
59#define unsigned signed
60typedef __SIZE_TYPE__ _ssize_t;
61#undef unsigned
62#else
63#if defined(__SIZEOF_INT__) && __SIZEOF_SIZE_T__ == __SIZEOF_INT__
64typedef int _ssize_t;
65#elif defined(__SIZEOF_LONG__) && __SIZEOF_SIZE_T__ == __SIZEOF_LONG__
66typedef long _ssize_t;
67#elif defined(__SIZEOF_LONG_LONG__) && __SIZEOF_SIZE_T__ == __SIZEOF_LONG_LONG__
68typedef long long _ssize_t;
69#elif defined(__INT_MAX__) && __INT_MAX__ == 2147483647
70typedef int _ssize_t;
71#else
72typedef long _ssize_t;
73#endif
74#endif
75#endif
76
77#define __need_wint_t
78#include <stddef.h>
79
80#ifndef __mbstate_t_defined
81/* Conversion state information.  */
82typedef struct
83{
84  int __count;
85  union
86  {
87    wint_t __wch;
88    unsigned char __wchb[4];
89  } __value;		/* Value so far.  */
90} _mbstate_t;
91#endif
92
93#ifndef __flock_t_defined
94typedef _LOCK_RECURSIVE_T _flock_t;
95#endif
96
97#ifndef __iconv_t_defined
98/* Iconv descriptor type */
99typedef void *_iconv_t;
100#endif
101
102#endif	/* _SYS__TYPES_H */
103