1sys_types.h(0P) POSIX Programmer's Manual sys_types.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 sys/types.h — data types
13
15 #include <sys/types.h>
16
18 The <sys/types.h> header shall define at least the following types:
19
20 blkcnt_t Used for file block counts.
21
22 blksize_t Used for block sizes.
23
24 clock_t Used for system times in clock ticks or CLOCKS_PER_SEC;
25 see <time.h>.
26
27 clockid_t Used for clock ID type in the clock and timer func‐
28 tions.
29
30 dev_t Used for device IDs.
31
32 fsblkcnt_t Used for file system block counts.
33
34 fsfilcnt_t Used for file system file counts.
35
36 gid_t Used for group IDs.
37
38 id_t Used as a general identifier; can be used to contain at
39 least a pid_t, uid_t, or gid_t.
40
41 ino_t Used for file serial numbers.
42
43 key_t Used for XSI interprocess communication.
44
45 mode_t Used for some file attributes.
46
47 nlink_t Used for link counts.
48
49 off_t Used for file sizes.
50
51 pid_t Used for process IDs and process group IDs.
52
53 pthread_attr_t Used to identify a thread attribute object.
54
55 pthread_barrier_t
56 Used to identify a barrier.
57
58 pthread_barrierattr_t
59 Used to define a barrier attributes object.
60
61 pthread_cond_t Used for condition variables.
62
63 pthread_condattr_t
64 Used to identify a condition attribute object.
65
66 pthread_key_t Used for thread-specific data keys.
67
68 pthread_mutex_t Used for mutexes.
69
70 pthread_mutexattr_t
71 Used to identify a mutex attribute object.
72
73 pthread_once_t Used for dynamic package initialization.
74
75 pthread_rwlock_t
76 Used for read-write locks.
77
78 pthread_rwlockattr_t
79 Used for read-write lock attributes.
80
81 pthread_spinlock_t
82 Used to identify a spin lock.
83
84 pthread_t Used to identify a thread.
85
86 size_t Used for sizes of objects.
87
88 ssize_t Used for a count of bytes or an error indication.
89
90 suseconds_t Used for time in microseconds.
91
92 time_t Used for time in seconds.
93
94 timer_t Used for timer ID returned by timer_create().
95
96 trace_attr_t Used to identify a trace stream attributes object
97
98 trace_event_id_t
99 Used to identify a trace event type.
100
101 trace_event_set_t
102 Used to identify a trace event type set.
103
104 trace_id_t Used to identify a trace stream.
105
106 uid_t Used for user IDs.
107
108 All of the types shall be defined as arithmetic types of an appropriate
109 length, with the following exceptions:
110
111 pthread_attr_t
112 pthread_barrier_t
113 pthread_barrierattr_t
114 pthread_cond_t
115 pthread_condattr_t
116 pthread_key_t
117 pthread_mutex_t
118 pthread_mutexattr_t
119 pthread_once_t
120 pthread_rwlock_t
121 pthread_rwlockattr_t
122 pthread_spinlock_t
123 pthread_t
124 timer_t
125 trace_attr_t
126 trace_event_id_t
127 trace_event_set_t
128 trace_id_t
129
130 Additionally:
131
132 * mode_t shall be an integer type.
133
134 * dev_t shall be an integer type.
135
136 * nlink_t, uid_t, gid_t, and id_t shall be integer types.
137
138 * blkcnt_t and off_t shall be signed integer types.
139
140 * fsblkcnt_t, fsfilcnt_t, and ino_t shall be defined as unsigned
141 integer types.
142
143 * size_t shall be an unsigned integer type.
144
145 * blksize_t, pid_t, and ssize_t shall be signed integer types.
146
147 * clock_t shall be an integer or real-floating type. time_t shall be
148 an integer type.
149
150 The type ssize_t shall be capable of storing values at least in the
151 range [-1, {SSIZE_MAX}].
152
153 The type suseconds_t shall be a signed integer type capable of storing
154 values at least in the range [-1, 1000000].
155
156 The implementation shall support one or more programming environments
157 in which the widths of blksize_t, pid_t, size_t, ssize_t, and susec‐
158 onds_t are no greater than the width of type long. The names of these
159 programming environments can be obtained using the confstr() function
160 or the getconf utility.
161
162 There are no defined comparison or assignment operators for the follow‐
163 ing types:
164
165 pthread_attr_t
166 pthread_barrier_t
167 pthread_barrierattr_t
168 pthread_cond_t
169 pthread_condattr_t
170 pthread_mutex_t
171 pthread_mutexattr_t
172 pthread_rwlock_t
173 pthread_rwlockattr_t
174 pthread_spinlock_t
175 timer_t
176 trace_attr_t
177
178 The following sections are informative.
179
181 None.
182
184 None.
185
187 None.
188
190 <time.h>
191
192 The System Interfaces volume of POSIX.1‐2017, confstr()
193
194 The Shell and Utilities volume of POSIX.1‐2017, getconf
195
197 Portions of this text are reprinted and reproduced in electronic form
198 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
199 table Operating System Interface (POSIX), The Open Group Base Specifi‐
200 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
201 Electrical and Electronics Engineers, Inc and The Open Group. In the
202 event of any discrepancy between this version and the original IEEE and
203 The Open Group Standard, the original IEEE and The Open Group Standard
204 is the referee document. The original Standard can be obtained online
205 at http://www.opengroup.org/unix/online.html .
206
207 Any typographical or formatting errors that appear in this page are
208 most likely to have been introduced during the conversion of the source
209 files to man page format. To report such errors, see https://www.ker‐
210 nel.org/doc/man-pages/reporting_bugs.html .
211
212
213
214IEEE/The Open Group 2017 sys_types.h(0P)