f_offset

Jeff Roberson jroberson at jroberson.net
Sun Apr 13 08:24:06 UTC 2008


On Sun, 13 Apr 2008, Poul-Henning Kamp wrote:

> In message <20080412132457.W43186 at desktop>, Jeff Roberson writes:
>
>> It's worth discussing what posix actually guarantees for f_offset as well
>> as what other operating systems do.
>
> I think DWIM is quite easily defined here:  concurrent access only
> makes sense with pwrite[v](2)/pread[v](2).

It may only make sense with p* but it happens without.  If "DWIM" means 
"do what it means" posix is purposefully permissive in the requirements 
for f_offset because existing implementations were non-serializing.

>
> The non p-prefix versions should always be serialized, because there
> is know way of knowing where they read/write if you don't.

Well that's at odds with what the standard says and what others implement. 
I think there is a clear case for serializing writes.  I don't see what 
advantage we get from serializing reads.  The heavy cost of 
synchronization should be justified by actual need.

Thanks,
Jeff

>
> -- 
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>


More information about the freebsd-arch mailing list