5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 Desc: ANSI-C header file sys/types.h
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 *************************************/
32 typedef unsigned char u_char
;
33 typedef unsigned short u_short
;
34 typedef unsigned int u_int
;
35 typedef unsigned long u_long
;
39 typedef unsigned short ushort
; /* Sys V compatibility */
40 typedef unsigned int uint
; /* Sys V compatibility */
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 */
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() *****************************************/
104 #define FD_SETSIZE 64
107 typedef int32_t fd_mask
;
108 #define NFDBITS (sizeof(fd_mask) * NBBY)
111 #define howmany(x, y) (((x) + ((y) - 1)) / (y))
114 typedef struct fd_set
{
115 fd_mask fds_bits
[howmany(FD_SETSIZE
, NFDBITS
)];
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_ */