Subject: lib/6072: stdio documentation bug
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@araneus.fi>
List: netbsd-bugs
Date: 08/30/1998 20:39:46
>Number: 6072
>Category: lib
>Synopsis: stdio documentation bug
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people (Library Bug People)
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Sun Aug 30 16:20:09 1998
>Last-Modified:
>Originator: Andreas Gustafsson
>Organization:
Araneus Information Systems Oy
>Release: 1.3.2
>Environment:
System: NetBSD guava.araneus.fi 1.3.2 NetBSD 1.3.2 (GUAVA) #2: Wed Aug 5 09:44:51 EEST 1998 root@guava.araneus.fi:/z/src-1.3/sys/arch/i386/compile/GUAVA i386
>Description:
The fopen(3) man page states:
Reads and writes may be intermixed on read/write streams in any order,
and do not require an intermediate seek as in previous versions of stdio.
This claim is incorrect.
>How-To-Repeat:
Run the following test program and examine the contents of the
resulting file.
#include <err.h>
#include <stdio.h>
int main(int argc, char **argv)
{
FILE *fp;
int i;
/* Make a file containing 16384 spaces */
fp = fopen("test.fil", "w");
if (!fp) err(1, "fopen");
for (i = 0; i < 16384; i++)
putc(' ', fp);
fclose(fp);
/*
Reopen the file, read the first two characters and then
attempt to replace the third one with an "X".
*/
fp = fopen("test.fil", "r+");
if (!fp) err(1, "fopen");
getc(fp);
getc(fp);
putc('X', fp);
fclose(fp);
}
/* Now examine the file and notice the third character is not an "X". */
>Fix:
Remove the paragraph containing the quoted text from the man page.
>Audit-Trail:
>Unformatted: