1 .\" Copyright (c) 2020 by Alejandro Colomar <colomar.6.4.3@gmail.com>
2 .\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .TH SYSTEM_DATA_TYPES 7 2021-03-22 "Linux man-pages (unreleased)"
9 system_data_types \- overview of system data types
12 .\" A list of type names (the struct/union keyword will be omitted).
13 .\" Each entry will have the following parts:
14 .\" * Include (see NOTES)
16 .\" * Definition (no "Definition" header)
17 .\" Only struct/union types will have definition;
18 .\" typedefs will remain opaque.
20 .\" * Description (no "Description" header)
21 .\" A few lines describing the type.
23 .\" * Versions (optional)
25 .\" * Conforming to (see NOTES)
26 .\" Format: CXY and later; POSIX.1-XXXX and later.
28 .\" * Notes (optional)
33 .\"------------------------------------- aiocb ------------------------/
34 .\"------------------------------------- blkcnt_t ---------------------/
35 .\"------------------------------------- blksize_t --------------------/
36 .\"------------------------------------- cc_t -------------------------/
37 .\"------------------------------------- clock_t ----------------------/
38 .\"------------------------------------- clockid_t --------------------/
39 .\"------------------------------------- dev_t ------------------------/
40 .\"------------------------------------- div_t ------------------------/
41 .\"------------------------------------- double_t ---------------------/
42 .\"------------------------------------- fd_set -----------------------/
43 .\"------------------------------------- fenv_t -----------------------/
44 .\"------------------------------------- fexcept_t --------------------/
45 .\"------------------------------------- FILE -------------------------/
46 .\"------------------------------------- float_t ----------------------/
47 .\"------------------------------------- gid_t ------------------------/
48 .\"------------------------------------- id_t -------------------------/
49 .\"------------------------------------- imaxdiv_t --------------------/
50 .\"------------------------------------- intmax_t ---------------------/
51 .\"------------------------------------- intN_t -----------------------/
52 .\"------------------------------------- intptr_t ---------------------/
53 .\"------------------------------------- lconv ------------------------/
54 .\"------------------------------------- ldiv_t -----------------------/
55 .\"------------------------------------- lldiv_t ----------------------/
56 .\"------------------------------------- mode_t -----------------------/
57 .\"------------------------------------- off64_t ----------------------/
58 .\"------------------------------------- off_t ------------------------/
59 .\"------------------------------------- pid_t ------------------------/
60 .\"------------------------------------- ptrdiff_t --------------------/
61 .\"------------------------------------- regex_t ----------------------/
62 .\"------------------------------------- regmatch_t -------------------/
63 .\"------------------------------------- regoff_t ---------------------/
64 .\"------------------------------------- sigevent ---------------------/
78 int sigev_notify; /* Notification type */
79 int sigev_signo; /* Signal number */
80 union sigval sigev_value; /* Signal value */
81 void (*sigev_notify_function)(union sigval);
82 /* Notification function */
83 pthread_attr_t *sigev_notify_attributes;
84 /* Notification attributes */
88 For further details about this type, see
100 POSIX.1-2001 and later.
103 .BR timer_create (2),
104 .BR getaddrinfo_a (3),
110 structure in this page.
112 .\"------------------------------------- siginfo_t --------------------/
123 int si_signo; /* Signal number */
124 int si_code; /* Signal code */
125 pid_t si_pid; /* Sending process ID */
126 uid_t si_uid; /* Real user ID of sending process */
127 void *si_addr; /* Address of faulting instruction */
128 int si_status; /* Exit value or signal */
129 union sigval si_value; /* Signal value */
133 Information associated with a signal.
134 For further details on this structure
135 (including additional, Linux-specific fields), see
138 .IR "Conforming to" :
139 POSIX.1-2001 and later.
142 .BR pidfd_send_signal (2),
143 .BR rt_sigqueueinfo (2),
148 .\"------------------------------------- sigset_t ---------------------/
159 This is a type that represents a set of signals.
160 According to POSIX, this shall be an integer or structure type.
162 .IR "Conforming to" :
163 POSIX.1-2001 and later.
177 .\"------------------------------------- sigval -----------------------/
186 int sigval_int; /* Integer value */
187 void *sigval_ptr; /* Pointer value */
191 Data passed with a signal.
193 .IR "Conforming to" :
194 POSIX.1-2001 and later.
197 .BR pthread_sigqueue (3),
209 .\"------------------------------------- size_t -----------------------/
210 .\"------------------------------------- sockaddr ---------------------/
211 .\"------------------------------------- socklen_t --------------------/
212 .\"------------------------------------- ssize_t ----------------------/
213 .\"------------------------------------- stat -------------------------/
214 .\"------------------------------------- suseconds_t ------------------/
215 .\"------------------------------------- time_t -----------------------/
216 .\"------------------------------------- timer_t ----------------------/
217 .\"------------------------------------- timespec ---------------------/
218 .\"------------------------------------- timeval ----------------------/
219 .\"------------------------------------- uid_t ----------------------/
220 .\"------------------------------------- uintmax_t --------------------/
221 .\"------------------------------------- uintN_t ----------------------/
222 .\"------------------------------------- uintptr_t --------------------/
223 .\"------------------------------------- useconds_t -------------------/
224 .\"------------------------------------- va_list ----------------------/
225 .\"------------------------------------- void * -----------------------/
226 .\"--------------------------------------------------------------------/
228 The structures described in this manual page shall contain,
229 at least, the members shown in their definition, in no particular order.
231 Most of the integer types described in this page don't have
232 a corresponding length modifier for the
236 families of functions.
237 To print a value of an integer type that doesn't have a length modifier,
238 it should be converted to
243 To scan into a variable of an integer type
244 that doesn't have a length modifier,
245 an intermediate temporary variable of type
250 When copying from the temporary variable to the destination variable,
251 the value could overflow.
252 If the type has upper and lower limits,
253 the user should check that the value is within those limits,
254 before actually copying the value.
255 The example below shows how these conversions should be done.
256 .SS Conventions used in this page
257 In "Conforming to" we only concern ourselves with
258 C99 and later and POSIX.1-2001 and later.
259 Some types may be specified in earlier versions of one of these standards,
260 but in the interests of simplicity we omit details from earlier standards.
262 In "Include", we first note the "primary" header(s) that
263 define the type according to either the C or POSIX.1 standards.
264 Under "Alternatively", we note additional headers that
265 the standards specify shall define the type.
267 The program shown below scans from a string and prints a value stored in
268 a variable of an integer type that doesn't have a length modifier.
269 The appropriate conversions from and to
271 and the appropriate range checks,
272 are used as explained in the notes section above.
278 #include <sys/types.h>
283 static const char *const str = "500000 us in half a second";
287 /* Scan the number from the string into the temporary variable. */
289 sscanf(str, "%jd", &tmp);
291 /* Check that the value is within the valid range of suseconds_t. */
293 if (tmp < \-1 || tmp > 1000000) {
294 fprintf(stderr, "Scanned value outside valid range!\en");
298 /* Copy the value to the suseconds_t variable \(aqus\(aq. */
302 /* Even though suseconds_t can hold the value \-1, this isn\(aqt
303 a sensible number of microseconds. */
306 fprintf(stderr, "Scanned value shouldn\(aqt be negative!\en");
310 /* Print the value. */
312 printf("There are %jd microseconds in half a second.\en",
319 .BR feature_test_macros (7),