From 399644e47874bff147afb19c89228901ac39340e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:40:15 +0200 Subject: Adding upstream version 6.05.01. Signed-off-by: Daniel Baumann --- man3type/size_t.3type | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 man3type/size_t.3type (limited to 'man3type/size_t.3type') diff --git a/man3type/size_t.3type b/man3type/size_t.3type new file mode 100644 index 0000000..9df433a --- /dev/null +++ b/man3type/size_t.3type @@ -0,0 +1,181 @@ +.\" 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) -- cgit v1.2.3