tech-userlevel archive

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

Re: possible bug in fseek of buffered files shared between processes (example uses stdin)

On Tue, Nov 02, 2021 at 10:53:55AM -0700, Carlo Arenas wrote:
> Note that the failure in this case can be "fixed" by instead calling
> lseek directly, removing the buffer or skipping this early return in
> src/lib/libc/stdio/fseeko.c (lines 210 to 228), and that I am showing
> below (might be mangled by copy and paste):

I am not sure how you conclude this would violate Posix or the C
standard. The behaviour inside the single program is correct, and I
don't see any guarantees about shared files and current file position
usage when using buffered stdio - but maybe I am overlooking something.


Home | Main Index | Thread Index | Old Index