1 /* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
21 #define _GNU_TYPES_H 1
24 /* Convenience types. */
25 typedef unsigned char __u_char
;
26 typedef unsigned short __u_short
;
27 typedef unsigned int __u_int
;
28 typedef unsigned long __u_long
;
30 typedef unsigned long long int __u_quad_t
;
31 typedef long long int __quad_t
;
32 typedef __quad_t
*__qaddr_t
;
43 typedef int __dev_t
; /* Type of device numbers. */
44 typedef unsigned int __uid_t
; /* Type of user identifications. */
45 typedef unsigned int __gid_t
; /* Type of group identifications. */
46 typedef unsigned int __ino_t
; /* Type of file serial numbers. */
47 typedef unsigned int __mode_t
; /* Type of file attribute bitmasks. */
48 typedef unsigned short int __nlink_t
; /* Type of file link counts. */
49 typedef long int __off_t
; /* Type of file sizes and offsets. */
50 typedef int __pid_t
; /* Type of process identifications. */
51 typedef int __ssize_t
; /* Type of a byte count, or error. */
52 typedef __u_quad_t __fsid_t
; /* Type of file system IDs. */
54 /* Everythin' else. */
55 typedef long int __daddr_t
; /* The type of a disk address. */
56 typedef char *__caddr_t
;
57 typedef long int __time_t
;
58 typedef long int __swblk_t
; /* Type of a swap block maybe? */
60 /* fd_set for select. */
62 /* Number of descriptors that can fit in an `fd_set'. */
63 #define __FD_SETSIZE 256
65 /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
66 #define __NFDBITS (sizeof (unsigned long int) * 8)
67 #define __FDELT(d) ((d) / __NFDBITS)
68 #define __FDMASK(d) (1 << ((d) % __NFDBITS))
72 /* Some braindead old software uses this member name. */
73 unsigned long int fds_bits
[(__FD_SETSIZE
+ (__NFDBITS
- 1)) / __NFDBITS
];
76 /* This line MUST be split! Otherwise m4 will not change it. */
77 #define __FD_ZERO(set) \
78 ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set)))
79 #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
80 #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
81 #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
84 #endif /* gnu/types.h */