Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2008 22:24:22 -1000 (HST)
From:      Jeff Roberson <jroberson@jroberson.net>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: f_offset 
Message-ID:  <20080412221654.S959@desktop>
In-Reply-To: <18354.1208070351@critter.freebsd.dk>
References:  <18354.1208070351@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 13 Apr 2008, Poul-Henning Kamp wrote:

> In message <20080412132457.W43186@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@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.
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080412221654.S959>