{"id":7103,"date":"2022-12-20T19:35:17","date_gmt":"2022-12-20T22:35:17","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ferror-man3\/"},"modified":"2022-12-20T19:35:17","modified_gmt":"2022-12-20T22:35:17","slug":"ferror-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ferror-man3\/","title":{"rendered":"FERROR (man3)"},"content":{"rendered":"<h1 align=\"center\">FERROR<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#ATTRIBUTES\">ATTRIBUTES<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">clearerr, feof, ferror, fileno \u2212 check and reset stream status<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <stdio.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>void clearerr(FILE *<\/b><i>stream<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int feof(FILE *<\/b><i>stream<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int ferror(FILE *<\/b><i>stream<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>int fileno(FILE *<\/b><i>stream<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:5%; margin-top: 1em\">Feature Test Macro Requirements for glibc (see <b>feature_test_macros<\/b>(7)):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fileno<\/b>(): _POSIX_C_SOURCE<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The function <b>clearerr<\/b>() clears the end-of-file and error indicators for the stream pointed to by <i>stream<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The function <b>feof<\/b>() tests the end-of-file indicator for the stream pointed to by <i>stream<\/i>, returning nonzero if it is set. The end-of-file indicator can be cleared only by the function <b>clearerr<\/b>().<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The function <b>ferror<\/b>() tests the error indicator for the stream pointed to by <i>stream<\/i>, returning nonzero if it is set. The error indicator can be reset only by the <b>clearerr<\/b>() function.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The function <b>fileno<\/b>() examines the argument <i>stream<\/i> and returns the integer file descriptor used to implement this stream. The file descriptor is still owned by <i>stream<\/i> and will be closed when <b>fclose<\/b>(3) is called. Duplicate the file descriptor with <b>dup<\/b>(2) before passing it to code that might close it.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For nonlocking counterparts, see <b>unlocked_stdio<\/b>(3).<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These functions should not fail and do not set the external variable <i>errno<\/i>. (However, in case <b>fileno<\/b>() detects that its argument is not a valid stream, it must return \u22121 and set <i>errno<\/i> to <b>EBADF<\/b>.)<\/p>\n<h2>ATTRIBUTES <a name=\"ATTRIBUTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of the terms used in this section, see <b>attributes<\/b>(7).<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"> <\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"8%\"> <\/td>\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p align=\"center\"><img decoding=\"async\" src=\"grohtml-1630321.png\" alt=\"Image grohtml-1630321.png\"><\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The functions <b>clearerr<\/b>(), <b>feof<\/b>(), and <b>ferror<\/b>() conform to C89, C99, POSIX.1-2001, and POSIX.1-2008.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The function <b>fileno<\/b>() conforms to POSIX.1-2001 and POSIX.1-2008.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>open<\/b>(2), <b>fdopen<\/b>(3), <b>stdio<\/b>(3), <b>unlocked_stdio<\/b>(3)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  clearerr, feof, ferror, fileno \u2212 check and reset stream status <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,2340,3007],"class_list":["post-7103","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-ferror","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7103"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7103\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}