types.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* bits/types.h -- definitions of __*_t types underlying *_t types.
  2. Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  3. 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 Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. /*
  17. * Never include this file directly; use <sys/types.h> instead.
  18. */
  19. #ifndef _BITS_TYPES_H
  20. #define _BITS_TYPES_H 1
  21. #include <features.h>
  22. #include <bits/wordsize.h>
  23. #define __need_size_t
  24. #include <stddef.h>
  25. #include <bits/kernel_types.h>
  26. /* Convenience types. */
  27. typedef unsigned char __u_char;
  28. typedef unsigned short int __u_short;
  29. typedef unsigned int __u_int;
  30. typedef unsigned long int __u_long;
  31. /* Fixed-size types, underlying types depend on word size and compiler. */
  32. typedef signed char __int8_t;
  33. typedef unsigned char __uint8_t;
  34. typedef signed short int __int16_t;
  35. typedef unsigned short int __uint16_t;
  36. typedef signed int __int32_t;
  37. typedef unsigned int __uint32_t;
  38. #if __WORDSIZE == 64
  39. typedef signed long int __int64_t;
  40. typedef unsigned long int __uint64_t;
  41. #elif defined(__GNUC__)
  42. __extension__ typedef signed long long int __int64_t;
  43. __extension__ typedef unsigned long long int __uint64_t;
  44. #endif
  45. /* quad_t is also 64 bits. */
  46. #if __WORDSIZE == 64
  47. typedef long int __quad_t;
  48. typedef unsigned long int __u_quad_t;
  49. #elif defined(__GNUC__)
  50. __extension__ typedef long long int __quad_t;
  51. __extension__ typedef unsigned long long int __u_quad_t;
  52. #else
  53. typedef struct
  54. {
  55. long __val[2];
  56. } __quad_t;
  57. typedef struct
  58. {
  59. __u_long __val[2];
  60. } __u_quad_t;
  61. #endif
  62. #if __WORDSIZE == 32
  63. # define __SWORD_TYPE int
  64. #elif __WORDSIZE == 64
  65. # define __SWORD_TYPE long int
  66. #else
  67. # error
  68. #endif
  69. typedef __u_quad_t __dev_t; /* Type of device numbers. */
  70. typedef __u_int __uid_t; /* Type of user identifications. */
  71. typedef __u_int __gid_t; /* Type of group identifications. */
  72. typedef __u_long __ino_t; /* Type of file serial numbers. */
  73. typedef __u_int __mode_t; /* Type of file attribute bitmasks. */
  74. typedef __u_int __nlink_t; /* Type of file link counts. */
  75. typedef long int __off_t; /* Type of file sizes and offsets. */
  76. typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
  77. typedef int __pid_t; /* Type of process identifications. */
  78. typedef __SWORD_TYPE __ssize_t; /* Type of a byte count, or error. */
  79. typedef __u_long __rlim_t; /* Type of resource counts. */
  80. typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
  81. typedef __u_int __id_t; /* General type for ID. */
  82. typedef struct
  83. {
  84. int __val[2];
  85. } __fsid_t; /* Type of file system IDs. */
  86. /* Everythin' else. */
  87. typedef int __daddr_t; /* The type of a disk address. */
  88. typedef __quad_t *__rqaddr_t;
  89. typedef char *__caddr_t;
  90. typedef long int __time_t;
  91. typedef unsigned int __useconds_t;
  92. typedef long int __suseconds_t;
  93. typedef long int __swblk_t; /* Type of a swap block maybe? */
  94. typedef long int __clock_t;
  95. /* Clock ID used in clock and timer functions. */
  96. typedef int __clockid_t;
  97. /* Timer ID returned by `timer_create'. */
  98. typedef void *__timer_t;
  99. /* Number of descriptors that can fit in an `fd_set'. */
  100. #define __FD_SETSIZE 1024
  101. typedef int __key_t;
  102. /* Used in `struct shmid_ds'. */
  103. typedef __kernel_ipc_pid_t __ipc_pid_t;
  104. /* Type to represent block size. */
  105. typedef long int __blksize_t;
  106. /* Types from the Large File Support interface. */
  107. /* Type to count number os disk blocks. */
  108. typedef long int __blkcnt_t;
  109. typedef __quad_t __blkcnt64_t;
  110. /* Type to count file system blocks. */
  111. typedef __u_long __fsblkcnt_t;
  112. typedef __u_quad_t __fsblkcnt64_t;
  113. /* Type to count file system inodes. */
  114. typedef __u_long __fsfilcnt_t;
  115. typedef __u_quad_t __fsfilcnt64_t;
  116. /* Type of file serial numbers. */
  117. typedef __u_quad_t __ino64_t;
  118. /* Type of file sizes and offsets. */
  119. typedef __loff_t __off64_t;
  120. /* Used in XTI. */
  121. typedef long int __t_scalar_t;
  122. typedef unsigned long int __t_uscalar_t;
  123. /* Duplicates info from stdint.h but this is used in unistd.h. */
  124. typedef __SWORD_TYPE __intptr_t;
  125. /* Duplicate info from sys/socket.h. */
  126. typedef unsigned int __socklen_t;
  127. /* Now add the thread types. */
  128. #if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98)
  129. # include <bits/pthreadtypes.h>
  130. #endif
  131. #endif /* bits/types.h */