[Bug 215848] fopen(3): Incorrect good practice suggestion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=215848

--- Comment #1 from Avinash Sonawane (rootkea@xxxxxxxxx) ---
I think we should only mention using `fseek` as a good practice between read
and write operations since:
a. fflush can't be used on input stream i.e. if last operation was read while
fseek() can be used between read-write or write-read.

b. fsetpos needs fgetpos to be called first. So let's drop `fgetpos+fsetpos`
from the good practice suggestion

So I suggest this small change:
diff --git a/man3/fopen.3 b/man3/fopen.3
index a1d781706..fb289a537 100644
--- a/man3/fopen.3
+++ b/man3/fopen.3
@@ -138,8 +138,6 @@ result of writes other than the most recent.)
 Therefore it is good practice (and indeed sometimes necessary
 under Linux) to put an
 .BR fseek (3)
-or
-.BR fgetpos (3)
 operation between write and read operations on such a stream.
 This operation may be an apparent no-op
 (as in \fIfseek(..., 0L, SEEK_CUR)\fP

Thanks!

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux