* Removed sys/_types.h include, all types are now defined in include files named...
[AROS.git] / compiler / clib / include / sys / types.h
blobb76ee4db1e2430f814ae66de790e3c7ea2749eea
1 #ifndef _SYS_TYPES_H_
2 #define _SYS_TYPES_H_
4 /*
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: ANSI-C header file sys/types.h
9 Lang: English
12 #include <sys/cdefs.h>
13 #include <aros/macros.h>
15 /* Some standard types */
16 #include <aros/types/size_t.h>
17 #include <aros/types/int_t.h>
19 /* These are additions to the types in <stdint.h> */
20 typedef uint64_t u_int64_t; /* 64-bit unsigned integer */
21 typedef uint32_t u_int32_t; /* 32-bit unsigned integer */
22 typedef uint16_t u_int16_t; /* 16-bit unsigned integer */
23 typedef uint8_t u_int8_t; /* 8-bit unsigned integer */
25 typedef uint64_t u_quad_t;
26 typedef int64_t quad_t;
27 typedef quad_t * qaddr_t;
29 /*** For compatibility with POSIX source *************************************/
31 #if __BSD_VISIBLE
32 typedef unsigned char u_char;
33 typedef unsigned short u_short;
34 typedef unsigned int u_int;
35 typedef unsigned long u_long;
36 #endif
38 #ifdef __SYSV_VISIBLE
39 typedef unsigned short ushort; /* Sys V compatibility */
40 typedef unsigned int uint; /* Sys V compatibility */
41 #endif
44 Standard POSIX/SUS/ISO C types
46 Note that some of these are capable of being defined in multiple header
47 files, and need protection from this.
50 #include <aros/types/blk_t.h> /* blkcnt_t and blksize_t */
51 #include <aros/types/clockid_t.h>
52 #include <aros/types/clock_t.h>
53 #include <aros/types/dev_t.h>
54 #include <aros/types/fs_t.h>
55 #include <aros/types/gid_t.h>
56 #include <aros/types/id_t.h>
57 #include <aros/types/ino_t.h>
58 #include <aros/types/key_t.h>
59 #include <aros/types/mode_t.h>
60 #include <aros/types/nlink_t.h>
61 #include <aros/types/off_t.h>
62 #include <aros/types/pid_t.h>
63 #include <aros/types/ssize_t.h>
64 #include <aros/types/socklen_t.h>
65 #include <aros/types/suseconds_t.h>
66 #include <aros/types/time_t.h>
67 #include <aros/types/timer_t.h>
68 #include <aros/types/uid_t.h>
69 #include <aros/types/useconds_t.h>
71 typedef char * caddr_t; /* Core address */
72 typedef int32_t daddr_t; /* Disk address */
73 typedef uint32_t fixpt_t; /* Fixed point number */
74 typedef int64_t rlim_t; /* Resource limit */
75 typedef int64_t segsz_t; /* Segment size */
76 typedef int32_t swblk_t; /* Swap offset */
78 /* These are not supported */
80 pthread_attr_t
81 pthread_cond_t
82 pthread_condattr_t
83 pthread_key_t
84 pthread_mutex_t
85 pthread_mutexattr_t
86 pthread_once_t
87 pthread_rwlock_t
88 pthread_rwlockattr_t
89 pthread_t
92 /*** Macros for endianness conversion ****************************************/
94 #define __htons(w) AROS_WORD2BE(w)
95 #define __htonl(l) AROS_LONG2BE(l)
96 #define __ntohs(w) AROS_BE2WORD(w)
97 #define __ntohl(l) AROS_BE2LONG(l)
99 /*** Defines and macros for select() *****************************************/
101 #define NBBY 8
103 #ifndef FD_SETSIZE
104 #define FD_SETSIZE 64
105 #endif
107 typedef int32_t fd_mask;
108 #define NFDBITS (sizeof(fd_mask) * NBBY)
110 #ifndef howmany
111 #define howmany(x, y) (((x) + ((y) - 1)) / (y))
112 #endif
114 typedef struct fd_set {
115 fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
116 } fd_set;
118 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
119 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
120 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
121 #define FD_COPY(f, t) memcpy(t, f, sizeof(*(f)))
122 #define FD_ZERO(p) memset(p, 0, sizeof(*(p)))
124 #endif /* _SYS_TYPES_H_ */