docs/76333: EOF indicator can be cleared by not only clearerr(3).

Yoshihiko Sarumaru mistral at imasy.or.jp
Mon Jan 17 07:30:25 UTC 2005


>Number:         76333
>Category:       docs
>Synopsis:       EOF indicator can be cleared by not only clearerr(3).
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 17 07:30:24 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Yoshihiko Sarumaru
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
>Environment:
System: FreeBSD shimako.yamayuri.org 4.11-STABLE FreeBSD 4.11-STABLE #1: Mon Jan 10 01:36:16 JST 2005 sarumaru at shimako.yamayuri.org:/usr/src/sys/compile/Z505VRK i386


	
>Description:
	The feof(3) tells that "The end-of-file indicator can only be cleared by the function clearerr()."
	But fseek(fp, 0, SEEK_SET) or writing extra bytes to the stream can clear the EOF indicator, too.

	POSIX (SUSv3) doesn't mention about it.
>How-To-Repeat:
	man 3 feof
>Fix:
This patch is for RELENG_4 (1.3.2.4) ferror.3, sorry.

--- /usr/src/lib/libc/stdio/ferror.3    Sat Dec 15 03:33:57 2001
+++ ferror.3    Mon Jan 17 16:24:45 2005
@@ -69,8 +69,6 @@
 tests the end-of-file indicator for the stream pointed to by
 .Fa stream ,
 returning non-zero if it is set.
-The end-of-file indicator can only be cleared by the function
-.Fn clearerr .
 .Pp
 The function
 .Fn ferror


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list