diff options
Diffstat (limited to 'man/man3const')
-rw-r--r-- | man/man3const/EOF.3const | 42 | ||||
-rw-r--r-- | man/man3const/EXIT_FAILURE.3const | 1 | ||||
-rw-r--r-- | man/man3const/EXIT_SUCCESS.3const | 61 | ||||
-rw-r--r-- | man/man3const/NULL.3const | 74 | ||||
-rw-r--r-- | man/man3const/PA_CHAR.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_DOUBLE.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLAG_LONG.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLAG_LONG_DOUBLE.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLAG_LONG_LONG.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLAG_PTR.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLAG_SHORT.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_FLOAT.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_INT.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_LAST.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_POINTER.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_STRING.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_WCHAR.3const | 1 | ||||
-rw-r--r-- | man/man3const/PA_WSTRING.3const | 1 |
18 files changed, 192 insertions, 0 deletions
diff --git a/man/man3const/EOF.3const b/man/man3const/EOF.3const new file mode 100644 index 0000000..61a244f --- /dev/null +++ b/man/man3const/EOF.3const @@ -0,0 +1,42 @@ +.\" Copyright (c) 2022 by Alejandro Colomar <alx@kernel.org> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.\" +.TH EOF 3const 2024-05-02 "Linux man-pages (unreleased)" +.SH NAME +EOF \- end of file or error indicator +.SH LIBRARY +Standard C library +.RI ( libc ) +.SH SYNOPSIS +.nf +.B #include <stdio.h> +.P +.BR "#define EOF " "/* ... */" +.fi +.SH DESCRIPTION +.B EOF +represents the end of an input file, or an error indication. +It is a negative value, of type +.IR int . +.P +.B EOF +is not a character +(it can't be represented by +.IR "unsigned char" ). +It is instead a sentinel value outside of the valid range for valid characters. +.SH CONFORMING TO +C99 and later; +POSIX.1-2001 and later. +.SH CAVEATS +Programs can't pass this value to an output function +to "write" the end of a file. +That would likely result in undefined behavior. +Instead, +closing the writing stream or file descriptor +that refers to such file +is the way to signal the end of that file. +.SH SEE ALSO +.BR feof (3), +.BR fgetc (3) diff --git a/man/man3const/EXIT_FAILURE.3const b/man/man3const/EXIT_FAILURE.3const new file mode 100644 index 0000000..ba0d62d --- /dev/null +++ b/man/man3const/EXIT_FAILURE.3const @@ -0,0 +1 @@ +.so man3const/EXIT_SUCCESS.3const diff --git a/man/man3const/EXIT_SUCCESS.3const b/man/man3const/EXIT_SUCCESS.3const new file mode 100644 index 0000000..29228ee --- /dev/null +++ b/man/man3const/EXIT_SUCCESS.3const @@ -0,0 +1,61 @@ +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.\" +.TH EXIT_SUCCESS 3const 2024-05-02 "Linux man-pages (unreleased)" +.SH NAME +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants +.SH LIBRARY +Standard C library +.RI ( libc ) +.SH SYNOPSIS +.nf +.B #include <stdlib.h> +.P +.BR "#define EXIT_SUCCESS " 0 +.BR "#define EXIT_FAILURE " "/* nonzero */" +.fi +.SH DESCRIPTION +.B EXIT_SUCCESS +and +.B EXIT_FAILURE +represent a successful and unsuccessful exit status respectively, +and can be used as arguments to the +.BR exit (3) +function. +.SH CONFORMING TO +C99 and later; +POSIX.1-2001 and later. +.SH EXAMPLES +.\" SRC BEGIN (EXIT_SUCCESS.c) +.EX +#include <stdio.h> +#include <stdlib.h> +\& +int +main(int argc, char *argv[]) +{ + FILE *fp; +\& + if (argc != 2) { + fprintf(stderr, "Usage: %s <file>\en", argv[0]); + exit(EXIT_FAILURE); + } +\& + fp = fopen(argv[1], "r"); + if (fp == NULL) { + perror(argv[1]); + exit(EXIT_FAILURE); + } +\& + /* Other code omitted */ +\& + fclose(fp); + exit(EXIT_SUCCESS); +} +.EE +.\" SRC END +.SH SEE ALSO +.BR exit (3), +.BR sysexits.h (3head) diff --git a/man/man3const/NULL.3const b/man/man3const/NULL.3const new file mode 100644 index 0000000..c9cdc37 --- /dev/null +++ b/man/man3const/NULL.3const @@ -0,0 +1,74 @@ +.\" Copyright (c) 2022 by Alejandro Colomar <alx@kernel.org> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.\" +.TH NULL 3const 2024-05-02 "Linux man-pages (unreleased)" +.SH NAME +NULL \- null pointer constant +.SH LIBRARY +Standard C library +.RI ( libc ) +.SH SYNOPSIS +.nf +.B #include <stddef.h> +.P +.B "#define NULL ((void *) 0)" +.fi +.SH DESCRIPTION +.B NULL +represents a null pointer constant, +that is, a pointer that does not point to anything. +.SH CONFORMING TO +C99 and later; +POSIX.1-2001 and later. +.SH NOTES +The following headers also provide +.BR NULL : +.IR <locale.h> , +.IR <stdio.h> , +.IR <stdlib.h> , +.IR <string.h> , +.IR <time.h> , +.IR <unistd.h> , +and +.IR <wchar.h> . +.SH CAVEATS +It is undefined behavior to dereference a null pointer, +and that usually causes a segmentation fault in practice. +.P +It is also undefined behavior to perform pointer arithmetic on it. +.P +.I NULL \- NULL +is undefined behavior, according to ISO C, but is defined to be 0 in C++. +.P +To avoid confusing human readers of the code, +do not compare pointer variables to +.BR 0 , +and do not assign +.B 0 +to them. +Instead, always use +.BR NULL . +.P +.B NULL +shouldn't be confused with +.BR NUL , +which is an +.BR ascii (7) +character, +represented in C as +.BR \[aq]\e0\[aq] . +.SH BUGS +When it is necessary to set a pointer variable to a null pointer, +it is not enough to use +.BR memset (3) +to zero the pointer +(this is usually done when zeroing a struct that contains pointers), +since ISO C and POSIX don't guarantee that a bit pattern of all 0s +represent a null pointer. +See the EXAMPLES section in +.BR getaddrinfo (3) +for an example program that does this correctly. +.SH SEE ALSO +.BR void (3type) diff --git a/man/man3const/PA_CHAR.3const b/man/man3const/PA_CHAR.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_CHAR.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_DOUBLE.3const b/man/man3const/PA_DOUBLE.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_DOUBLE.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLAG_LONG.3const b/man/man3const/PA_FLAG_LONG.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLAG_LONG.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLAG_LONG_DOUBLE.3const b/man/man3const/PA_FLAG_LONG_DOUBLE.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLAG_LONG_DOUBLE.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLAG_LONG_LONG.3const b/man/man3const/PA_FLAG_LONG_LONG.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLAG_LONG_LONG.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLAG_PTR.3const b/man/man3const/PA_FLAG_PTR.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLAG_PTR.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLAG_SHORT.3const b/man/man3const/PA_FLAG_SHORT.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLAG_SHORT.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_FLOAT.3const b/man/man3const/PA_FLOAT.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_FLOAT.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_INT.3const b/man/man3const/PA_INT.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_INT.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_LAST.3const b/man/man3const/PA_LAST.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_LAST.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_POINTER.3const b/man/man3const/PA_POINTER.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_POINTER.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_STRING.3const b/man/man3const/PA_STRING.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_STRING.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_WCHAR.3const b/man/man3const/PA_WCHAR.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_WCHAR.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head diff --git a/man/man3const/PA_WSTRING.3const b/man/man3const/PA_WSTRING.3const new file mode 100644 index 0000000..ad10bad --- /dev/null +++ b/man/man3const/PA_WSTRING.3const @@ -0,0 +1 @@ +.so man3head/printf.h.3head |