tech-userlevel archive

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

Re: Issues with lseek(2) on a block device



On Thu, Feb 22, 2024 at 08:13:28AM -0500, Mouse wrote:
> >>> lseek(fd, 0, SEEK_END);
> [on a disk device]
> 
> >> [...]
> > [...]
> > This is such a buggy behaviour that [...]
> 
> I wouldn't call it buggy, not unless there is a spec that it's supposed
> to conform to that says otherwise (even if the "spec" is just an
> author's description of intent), which is something I so far haven't
> seen reason to think exists.  It looks to me like "we didn't bother
> making it do anything in particular, so you get whatever it happens to
> give you".

In general:

If a file descriptor references anything other than a regular file, then
the assumptions that portable code can make about it are constrained.


Home | Main Index | Thread Index | Old Index