.\" Copyright (c) 2020-2022 by Alejandro Colomar .\" and Copyright (c) 2020 by Michael Kerrisk .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" .TH size_t 3type 2023-03-31 "Linux man-pages 6.05.01" .SH NAME size_t, ssize_t \- count of bytes .SH LIBRARY Standard C library .RI ( libc ) .SH SYNOPSIS .nf .B #include .PP .BR typedef " /* ... */ " size_t; .PP .B #include .PP .BR typedef " /* ... */ " ssize_t; .fi .SH DESCRIPTION .TP .I size_t Used for a count of bytes. It is the result of the .IR sizeof () operator. It is an unsigned integer type capable of storing values in the range .RB [ 0 , .BR SIZE_MAX ]. .TP .I ssize_t Used for a count of bytes or an error indication. It is a signed integer type capable of storing values at least in the range .RB [ \-1 , .BR SSIZE_MAX ]. .SS Use with printf(3) and scanf(3) .TP .I size_t The length modifier for .I size_t for the .BR printf (3) and the .BR scanf (3) families of functions is .BR z , resulting commonly in .B %zu or .B %zx for printing .I size_t values. .TP .I ssize_t glibc and most other implementations provide a length modifier for .I ssize_t for the .BR printf (3) and the .BR scanf (3) families of functions, which is .BR z ; resulting commonly in .B %zd or .B %zi for printing .I ssize_t values. Although .B z works for .I ssize_t on most implementations, portable POSIX programs should avoid using it\[em]for example, by converting the value to .I intmax_t and using its length modifier .RB ( j ). .SH STANDARDS .TP .I size_t C11, POSIX.1-2008. .TP .I ssize_t POSIX.1-2008. .PD .SH HISTORY .TP .I size_t C89, POSIX.1-2001. .TP .I ssize_t POSIX.1-2001. .PP .IR , .IR , .IR , .IR , .IR , .IR , .IR , and .I define .I size_t since POSIX.1-2008. .PP .IR , .IR , and .I define .I ssize_t since POSIX.1-2008. .SH NOTES .TP .I size_t The following headers also provide .IR size_t : .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , .IR , and .IR . .TP .I ssize_t The following headers also provide .IR ssize_t : .IR , .IR , .IR , .IR , .IR , .IR , .IR , and .IR . .SH SEE ALSO .BR read (2), .BR readlink (2), .BR readv (2), .BR recv (2), .BR send (2), .BR write (2), .BR fread (3), .BR fwrite (3), .BR memcmp (3), .BR memcpy (3), .BR memset (3), .BR offsetof (3), .BR ptrdiff_t (3type)