system_data_types(7)
๐ธ system_data_types(7) ๐ธ
okay bestie, welcome to the system_data_types glow-up tour ๐ this is a page from the Miscellaneous Information Manual, and it's basically the group chat where all our fave system data types get their little intro cards. let's get into it โจ
โจ NAME โจ
system_data_types โ bestie, it's literally an overview of system data types ๐
๐ฆ DESCRIPTION ๐ฆ
siginfo_t ๐ซถ
Include: <signal.h>. Alternatively, <sys/wait.h>.
typedef struct {
int si_signo; /* Signal number */
int si_code; /* Signal code */
pid_t si_pid; /* Sending process ID */
uid_t si_uid; /* Real user ID of sending process */
void *si_addr; /* Memory location which caused fault */
int si_status; /* Exit value or signal */
union sigval si_value; /* Signal value */
} siginfo_t;
so this one is the info bundle that rides along with a signal ๐. for the full tea on this struct (including the extra Linux-specific fields that aren't shown here, iykyk), go check out sigaction(2).
Conforming to: POSIX.1-2001 and later. โ
See also: pidfd_send_signal(2), rt_sigqueueinfo(2), sigaction(2), sigwaitinfo(2), psiginfo(3)
sigset_t ๐
Include: <signal.h>. Alternatively, <spawn.h>, or <sys/select.h>.
this type is Giving Set Of Signals, no cap โ it represents a whole little collection of signals. and per POSIX? it shall be an integer or a structure type. iconic of it honestly ๐
Conforming to: POSIX.1-2001 and later. โ
See also: epoll_pwait(2), ppoll(2), pselect(2), sigaction(2), signalfd(2), sigpending(2), sigprocmask(2), sigsuspend(2), sigwaitinfo(2), signal(7)
๐ NOTES ๐
okay so the structures described on this page shall contain, at minimum, the members shown in their definition โ and in no particular order, so don't be out here assuming the layout is locked in ๐ฅ.
now for the lowkey important part: most of the integer types described in this page don't have a corresponding length modifier for the printf(3) and scanf(3) families of functions ๐ญ. so here's the move:
- to print a value of an integer type that doesn't have a length modifier, you should convert it to
intmax_toruintmax_twith an explicit cast. - to scan into a variable of an integer type that doesn't have a length modifier, you should use an intermediate temporary variable of type
intmax_toruintmax_t. - when copying from the temporary variable to the destination variable, the value could overflow ๐ so if the type has upper and lower limits, the user should check that the value is within those limits before actually copying the value.
and the example below shows exactly how these conversions should be done, so don't skip it bestie ๐ซถ
Conventions used in this page ๐
- In "Conforming to" we only concern ourselves with C99 and later and POSIX.1-2001 and later. some types may be specified in earlier versions of one of these standards, but in the interests of simplicity we omit details from earlier standards. (yes, we're gatekeeping the lore for readability, sue us ๐ง)
- In "Include", we first note the "primary" header(s) that define the type according to either the C or POSIX.1 standards. Under "Alternatively", we note additional headers that the standards specify shall define the type. simple as that โจ
๐ฅ EXAMPLES ๐ฅ
The program shown below scans from a string and prints a value stored in a variable of an integer type that doesn't have a length modifier. The appropriate conversions from and to intmax_t, and the appropriate range checks, are used as explained in the notes section above. ๐ซถ
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
int
main (void)
{
static const char *const str = "500000 us in half a second";
suseconds_t us;
intmax_t tmp;
/* Scan the number from the string into the temporary variable. */
sscanf(str, "%jd", &tmp);
/* Check that the value is within the valid range of suseconds_t. */
if (tmp < -1 || tmp > 1000000) {
fprintf(stderr, "Scanned value outside valid range!\n");
exit(EXIT_FAILURE);
}
/* Copy the value to the suseconds_t variable 'us'. */
us = tmp;
/* Even though suseconds_t can hold the value -1, this isn't
a sensible number of microseconds. */
if (us < 0) {
fprintf(stderr, "Scanned value shouldn't be negative!\n");
exit(EXIT_FAILURE);
}
/* Print the value. */
printf("There are %jd microseconds in half a second.\n",
(intmax_t) us);
exit(EXIT_SUCCESS);
}
๐ SEE ALSO ๐
feature_test_macros(7), standards(7)
and that's the whole page bestie, you ate it up fr fr ๐ stay slay, keep your casts explicit, and always range-check before you copy ๐ฆ
sending you off with love from Linux man-pages 6.20, dated 2026-02-08 โ mwah, periodt** โจ๐ ๐
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- Copyright 2020, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms