standard system data types
contains the common data types used in the system. Although these are meant to
be used within the kernel, most of the system data types are accessible also
to user code. A companion header
, typically used
in the kernel, includes
additional types as well as other facilities (see
The following standards-compliant system data types are defined:
In addition, when included in user applications,
<pthread.h>, and thus it
defines also the types used in the POSIX Threads Library,
Each described type may vary across machines and operating
systems. Only the following properties are guaranteed by the
IEEE Std 1003.1-2001 (“POSIX.1”)
In addition to the standard types,
- The type ssize_t is capable of storing integer values at
least in the range [-1,
- The type useconds_t is an unsigned integer capable of
storing values at least in the range [0, 1000000].
- The type suseconds_t is a signed integer capable of
storing values at least in the range [-1, 1000000].
- The time_t and clock_t types are
either integers or real-floating types.
- The following types are integers: gid_t,
nlink_t, and uid_t.
- The following types are signed integers: blkcnt_t,
pid_t, and ssize_t.
- The following types are unsigned integers: fsblkcnt_t,
fsfilcnt_t, ino_t, and
<sys/types.h> defines some
data types specific to NetBSD. These are mostly used
in the kernel. A portable implementation should not rely on these types to be
available in other systems. Examples include:
It can be noted that the standard “C99 types”
described in stdint(3) are
preferred to the older fixed size integer types prefixed with an
“u_” (in other words, uint32_t should be
used instead of u_int32_t).
conforms to IEEE Std 1003.1-2001
(“POSIX.1”) with respect to the described standard types.
<sys/types.h> header first
appeared in Version 7 AT&T UNIX. In the
current form the header appeared in NetBSD 0.9.