Debian Codegraph @

upstream/debian-trixie/man3/EOF.3const

raw
1 .\" Copyright (c) 2022 by Alejandro Colomar <[email protected]>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\"
6 .TH EOF 3const 2024-05-26 "Linux man-pages 6.9.1"
7 .SH NAME
8 EOF \- end of file or error indicator
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc )
12 .SH SYNOPSIS
13 .nf
14 .B #include <stdio.h>
15 .P
16 .BR "#define EOF " "/* ... */"
17 .fi
18 .SH DESCRIPTION
19 .B EOF
20 represents the end of an input file, or an error indication.
21 It is a negative value, of type
22 .IR int .
23 .P
24 .B EOF
25 is not a character
26 (it can't be represented by
27 .IR "unsigned char" ).
28 It is instead a sentinel value outside of the valid range for valid characters.
29 .SH STANDARDS
30 C11, POSIX.1-2008.
31 .SH HISTORY
32 C89, POSIX.1-2001.
33 .SH CAVEATS
34 Programs can't pass this value to an output function
35 to "write" the end of a file.
36 That would likely result in undefined behavior.
37 Instead,
38 closing the writing stream or file descriptor
39 that refers to such file
40 is the way to signal the end of that file.
41 .SH SEE ALSO
42 .BR feof (3),
43 .BR fgetc (3)