1types.h(3HEAD) Headers types.h(3HEAD)
2
3
4
6 types.h, types - primitive system data types
7
9 #include <sys/types.h>
10
11
13 The data types defined in <sys/types.h> are as follows:
14
15 32-bit Solaris
16 The data types listed below are defined in <sys/types.h> for 32-bit
17 Solaris.
18
19 typedef struct { int r[1]; } *physadr;
20 typedef long clock_t;
21 typedef long daddr_t;
22 typedef char * caddr_t;
23 typedef unsigned char unchar;
24 typedef unsigned short ushort;
25 typedef unsigned int uint;
26 typedef unsigned long ulong_t;
27 typedef unsigned long ino_t;
28 typedef long uid_t;
29 typedef long gid_t;
30 typedef ulong_t nlink_t;
31 typedef ulong_t mode_t;
32 typedef short cnt_t;
33 typedef long time_t;
34 typedef int label_t[10];
35 typedef ulong_t dev_t;
36 typedef long off_t;
37 typedef long pid_t;
38 typedef long paddr_t;
39 typedef int key_t;
40 typedef unsigned char use_t;
41 typedef short sysid_t;
42 typedef short index_t;
43 typedef short lock_t;
44 typedef unsigned int size_t;
45 typedef long clock_t;
46 typedef long pid_t;
47
48
49 64-bit Solaris
50 The data types listed below are defined in <sys/types.h> for 64-bit
51 Solaris.
52
53 typedef long blkcnt_t
54 typedef long clock_t
55 typedef long daddr_t
56 typedef ulong_t dev_t
57 typedef ulong_t fsblkcnt_t
58 typedef ulong_t fsfilcnt_t
59 typedef int gid_t
60 typedef int id_t
61 typedef long ino_t
62 typedef int key_t
63 typedef uint_t major_t
64 typedef uint_t minor_t
65 typedef uint_t mode_t
66 typedef uint_t nlink_t
67 typedef int pid_t
68 typedef ptrdiff_t intptr_t
69 typedef ulong_t rlim_t
70 typedef ulong_t size_t
71 typedef uint_t speed_t
72 typedef long ssize_t
73 typedef long suseconds_t
74 typedef uint_t tcflag_t
75 typedef long time_t
76 typedef int uid_t
77 typedef int wchar_t
78
79
80 Preprocessor Symbols
81 For 32-bit programs, pointers and the C data types int and long are all
82 32-bit quantities. For 64-bit programs, pointers and the C data type
83 long are defined as 64-bit quantities.
84
85
86 The preprocessor symbol _ILP32, made visible by the inclusion of
87 <sys/types.h>, can be used with the preprocessor #ifdef construct to
88 define sections of code that will be compiled only as part of a 32-bit
89 version of a given C program.
90
91
92 The preprocessor symbol _LP64 can be used in the same way to define
93 sections of code that will be compiled only as part of a 64-bit version
94 of a given C program. See EXAMPLES.
95
96
97 This header incorporates definitions of other preprocessor symbols that
98 can be useful when keeping code portable between different instruction
99 set architectures.
100
101 _LITTLE_ENDIAN The natural byte order of the processor. A
102 _BIG_ENDIAN pointer to an int points to the least/most
103 significant byte of that int.
104
105
106 _STACK_GROWS_UPWARD The processor specific direction of stack
107 _STACK_GROWS_DOWNWARD growth. A push onto the stack
108 increases/decreases the stack pointer, so it
109 stores data at successively higher/lower
110 addresses.
111
112
113 _CHAR_IS_UNSIGNED The C Compiler implements objects of type
114 _CHAR_IS_SIGNED char as unsigned or signed respectively.
115 This is really an implementation choice of
116 the compiler, but it is specified in the ABI
117 and tends to be uniform across compilers for
118 an instruction set architecture.
119
120
121 _CHAR_ALIGNMENT The ABI defines alignment requirements of
122 _SHORT_ALIGNMENT each of the primitive object types. Some,
123 _INT_ALIGNMENT if not all, might be hardware requirements
124 _LONG_ALIGNMENT as well. The values are expressed in bytes.
125 _LONG_LONG_ALIGNMENT
126 _DOUBLE_ALIGNMENT
127 __LMOANXG__ADLOIUGBNLMEE_NATLIGNMENT The most stringent alignment requirement as
128 _POINTER_ALIGNMENT specified by the ABI. Equal to the maximum
129 _FLOAT_ALIGNMENT of all the above _XXX_ALIGNMENT values.
130
131
132 _LONG_LONG_ALIGNMENT_32 The 32-bit ABI supported by a 64-bit kernel
133 may have different alignment requirements
134 for primitive object types. The value of
135 this identifier is expressed in bytes.
136
137
139 The daddr_t type is used for disk addresses except in an inode on disk.
140 Times are encoded in seconds since 00:00:00 UTC, January 1, 1970. The
141 major and minor parts of a device code specify kind and unit number of
142 a device and are installation-dependent. Offsets are measured in bytes
143 from the beginning of a file.
144
145
146 The label_t[] types are used to save the processor state while another
147 process is running.
148
150 Example 1 Use of preprocessor symbol _LP64.
151
152
153 In the following example, the preprocessor symbol _LP64 defines sec‐
154 tions of code that will be compiled only as part of a 64-bit version of
155 the given C program.
156
157
158 #include <sys/types.h>
159 ...
160
161 #ifdef _LP64
162 printf("The data model is LP64 in this environment\n");
163 #else
164 #ifdef _ILP32
165 printf("The data model is ILP32 in this environment\n");
166 #else
167 #error "Unknown data model!"
168 #endif
169 #endif
170
171
173 See attributes(5) for descriptions of the following attributes:
174
175
176
177
178 ┌─────────────────────────────┬─────────────────────────────┐
179 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
180 ├─────────────────────────────┼─────────────────────────────┤
181 │Interface Stability │Stable │
182 └─────────────────────────────┴─────────────────────────────┘
183
185 types32.h(3HEAD), attributes(5), standards(5)
186
187
188
189SunOS 5.11 6 Oct 2004 types.h(3HEAD)