Update.
[glibc.git] / sysdeps / generic / bits / types.h
blobfdb36f0b546d121c1bdcbaea3b418571e17364c7
1 /* Copyright (C) 1991, 92, 94, 95, 96, 97 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 not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 * Never include this file directly; use <sys/types.h> instead.
23 #ifndef _BITS_TYPES_H
24 #define _BITS_TYPES_H 1
27 /* Convenience types. */
28 typedef unsigned char __u_char;
29 typedef unsigned short __u_short;
30 typedef unsigned int __u_int;
31 typedef unsigned long __u_long;
32 #ifdef __GNUC__
33 typedef unsigned long long int __u_quad_t;
34 typedef long long int __quad_t;
35 #else
36 typedef struct
38 long __val[2];
39 } __quad_t;
40 typedef struct
42 __u_long __val[2];
43 } __u_quad_t;
44 #endif
45 typedef signed char __int8_t;
46 typedef unsigned char __uint8_t;
47 typedef signed short int __int16_t;
48 typedef unsigned short int __uint16_t;
49 typedef signed int __int32_t;
50 typedef unsigned int __uint32_t;
51 #ifdef __GNUC__
52 typedef signed long long int __int64_t;
53 typedef unsigned long long int __uint64_t;
54 #endif
55 typedef __quad_t *__qaddr_t;
56 typedef int __dev_t; /* Type of device numbers. */
57 typedef unsigned int __uid_t; /* Type of user identifications. */
58 typedef unsigned int __gid_t; /* Type of group identifications. */
59 typedef unsigned int __ino_t; /* Type of file serial numbers. */
60 typedef unsigned int __mode_t; /* Type of file attribute bitmasks. */
61 typedef unsigned short int __nlink_t; /* Type of file link counts. */
62 typedef long int __off_t; /* Type of file sizes and offsets. */
63 typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
64 typedef int __pid_t; /* Type of process identifications. */
65 typedef int __ssize_t; /* Type of a byte count, or error. */
66 typedef __u_quad_t __fsid_t; /* Type of file system IDs. */
67 typedef long int __clock_t; /* Type of CPU usage counts. */
68 typedef long int __rlim_t; /* Type for resource measurement. */
69 typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
71 /* Everythin' else. */
72 typedef long int __daddr_t; /* The type of a disk address. */
73 typedef char *__caddr_t;
74 typedef long int __time_t;
75 typedef long int __swblk_t; /* Type of a swap block maybe? */
76 typedef long int __key_t; /* Type of an IPC key */
78 /* fd_set for select. */
80 /* Number of descriptors that can fit in an `fd_set'. */
81 #define __FD_SETSIZE 256
83 /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
84 #define __NFDBITS (sizeof (unsigned long int) * 8)
85 #define __FDELT(d) ((d) / __NFDBITS)
86 #define __FDMASK(d) (1 << ((d) % __NFDBITS))
88 typedef struct
90 /* XPG4.2 requires this member name. */
91 unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
92 } __fd_set;
94 typedef unsigned long int __fd_mask;
97 /* Types from the Large File Support interface. */
99 /* Type to count number os disk blocks. */
100 typedef long int __blkcnt_t;
101 typedef __quad_t __blkcnt64_t;
103 /* Type to count file system blocks. */
104 typedef unsigned int __fsblkcnt_t;
105 typedef __u_quad_t __fsblkcnt64_t;
107 /* Type to count file system inodes. */
108 typedef unsigned long int __fsfilcnt_t;
109 typedef __u_quad_t __fsfilcnt64_t;
111 #endif /* bits/types.h */