[PATCH] fadvise(2) system call

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Nov 13 10:54:32 UTC 2011


In message <4ebf4e1f.hkNuKvwPEzh2GJhi%perryh at pluto.rain.com>, perryh at pluto.rain
.com writes:
>Warner Losh <imp at bsdimp.com> wrote:

>> >> wrote:
>> >>> ... seek(2) is badly broken on tape drives.
>> >>> It does nothing and doesn't return an error ...
>> >> 
>> >> Honestly, I think we've got bigger problems to worry about
>> >> than whether lseek() works on magnetic tape drives ...
>> > 
>> > True, but failing silently -- doing nothing but not returning an
>> > error -- is a POLA violation.  Those are worth fixing simply on
>> > principle.
>>
>> Early Unix layering made that kinda hard... :(
>
>and yet, it somehow manages to return an error if applied to a pipe.
>There must be some point at which the inode type affects the result.

There is a big difference:  pipes operate at the fdesc level, devices
sit behind what can best be explained as a symlink into a different
name-space, and the cdevsw API does not pass the fdesc offset in.

-- 
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