update from main archive 961001
[glibc.git] / sysdeps / generic / gnu / types.h
blobf42fb7f5448513d17d95782604845ced2e69bc7d
1 /* Copyright (C) 1991, 92, 94, 95, 96 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. */
19 #ifndef _GNU_TYPES_H
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;
29 #ifdef __GNUC__
30 typedef unsigned long long int __u_quad_t;
31 typedef long long int __quad_t;
32 typedef __quad_t *__qaddr_t;
33 #else
34 typedef struct
36 long val[2];
37 } __quad_t;
38 typedef struct
40 __u_long val[2];
41 } __u_quad_t;
42 #endif
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. */
53 typedef long int __clock_t; /* Type of CPU usage counts. */
55 /* Everythin' else. */
56 typedef long int __daddr_t; /* The type of a disk address. */
57 typedef char *__caddr_t;
58 typedef long int __time_t;
59 typedef long int __swblk_t; /* Type of a swap block maybe? */
60 typedef long int __key_t; /* Type of an IPC key */
62 /* fd_set for select. */
64 /* Number of descriptors that can fit in an `fd_set'. */
65 #define __FD_SETSIZE 256
67 /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
68 #define __NFDBITS (sizeof (unsigned long int) * 8)
69 #define __FDELT(d) ((d) / __NFDBITS)
70 #define __FDMASK(d) (1 << ((d) % __NFDBITS))
72 typedef struct
74 /* Some braindead old software uses this member name. */
75 unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
76 } __fd_set;
78 typedef unsigned long __fd_mask;
80 /* This line MUST be split! Otherwise m4 will not change it. */
81 #define __FD_ZERO(set) \
82 ((void) memset ((__ptr_t) (set), 0, sizeof (fd_set)))
83 #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
84 #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
85 #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
87 #ifdef __USE_SVID
88 typedef long int key_t;
89 #endif
91 #endif /* gnu/types.h */