types.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. /*
  16. * Never include this file directly; use <sys/types.h> instead.
  17. */
  18. #ifndef _BITS_TYPES_H
  19. #define _BITS_TYPES_H 1
  20. #include <features.h>
  21. #define __need_size_t
  22. #include <stddef.h>
  23. /* Convenience types. */
  24. typedef unsigned char __u_char;
  25. typedef unsigned short __u_short;
  26. typedef unsigned int __u_int;
  27. typedef unsigned long __u_long;
  28. #ifdef __GNUC__
  29. __extension__ typedef unsigned long long int __u_quad_t;
  30. __extension__ typedef long long int __quad_t;
  31. #else
  32. typedef struct
  33. {
  34. long int __val[2];
  35. } __quad_t;
  36. typedef struct
  37. {
  38. __u_long __val[2];
  39. } __u_quad_t;
  40. #endif
  41. typedef signed char __int8_t;
  42. typedef unsigned char __uint8_t;
  43. typedef signed short int __int16_t;
  44. typedef unsigned short int __uint16_t;
  45. typedef signed int __int32_t;
  46. typedef unsigned int __uint32_t;
  47. #ifdef __GNUC__
  48. __extension__ typedef signed long long int __int64_t;
  49. __extension__ typedef unsigned long long int __uint64_t;
  50. #endif
  51. typedef __quad_t *__qaddr_t;
  52. typedef __u_quad_t __dev_t; /* Type of device numbers. */
  53. typedef __u_int __uid_t; /* Type of user identifications. */
  54. typedef __u_int __gid_t; /* Type of group identifications. */
  55. typedef __u_long __ino_t; /* Type of file serial numbers. */
  56. typedef __u_int __mode_t; /* Type of file attribute bitmasks. */
  57. typedef __u_int __nlink_t; /* Type of file link counts. */
  58. typedef long int __off_t; /* Type of file sizes and offsets. */
  59. typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
  60. typedef int __pid_t; /* Type of process identifications. */
  61. typedef int __ssize_t; /* Type of a byte count, or error. */
  62. typedef __u_long __rlim_t; /* Type of resource counts. */
  63. typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
  64. typedef __u_int __id_t; /* General type for ID. */
  65. typedef struct
  66. {
  67. int __val[2];
  68. } __fsid_t; /* Type of file system IDs. */
  69. /* Everythin' else. */
  70. typedef int __daddr_t; /* The type of a disk address. */
  71. typedef char *__caddr_t;
  72. typedef long int __time_t;
  73. typedef long int __swblk_t; /* Type of a swap block maybe? */
  74. typedef long int __clock_t;
  75. /* One element in the file descriptor mask array. */
  76. typedef unsigned long int __fd_mask;
  77. /* Number of descriptors that can fit in an `fd_set'. */
  78. #define __FD_SETSIZE 1024
  79. /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
  80. #ifndef __NFDBITS
  81. #define __NFDBITS (8 * sizeof (__fd_mask))
  82. #define __FDELT(d) ((d) / __NFDBITS)
  83. #define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
  84. #endif
  85. /* fd_set for select and pselect. */
  86. typedef struct
  87. {
  88. /* XPG4.2 requires this member name. Otherwise avoid the name
  89. from the global namespace. */
  90. #ifdef __USE_XOPEN
  91. __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
  92. # define __FDS_BITS(set) ((set)->fds_bits)
  93. #else
  94. __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
  95. # define __FDS_BITS(set) ((set)->__fds_bits)
  96. #endif
  97. } __fd_set;
  98. typedef int __key_t;
  99. /* Used in `struct shmid_ds'. */
  100. typedef unsigned short int __ipc_pid_t;
  101. /* Types from the Large File Support interface. */
  102. /* Type to count number os disk blocks. */
  103. typedef long int __blkcnt_t;
  104. typedef __quad_t __blkcnt64_t;
  105. /* Type to count file system blocks. */
  106. typedef __u_long __fsblkcnt_t;
  107. typedef __u_quad_t __fsblkcnt64_t;
  108. /* Type to count file system inodes. */
  109. typedef __u_long __fsfilcnt_t;
  110. typedef __u_quad_t __fsfilcnt64_t;
  111. /* Type of file serial numbers. */
  112. typedef __u_long __ino64_t;
  113. /* Type of file sizes and offsets. */
  114. typedef __loff_t __off64_t;
  115. /* Used in XTI. */
  116. typedef long int __t_scalar_t;
  117. typedef unsigned long int __t_uscalar_t;
  118. /* Duplicates info from stdint.h but this is used in unistd.h. */
  119. typedef int __intptr_t;
  120. /* Now add the thread types. */
  121. #ifdef __USE_UNIX98
  122. # include <bits/pthreadtypes.h>
  123. #endif
  124. #endif /* bits/types.h */