Current-Users archive

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

Re: Weirdness in comm(1)



On Mon, Nov 30, 2009 at 07:46:03PM -0500, Greg A. Woods wrote:
> At Mon, 30 Nov 2009 23:08:36 +0100, Joerg Sonnenberger 
> <joerg%britannica.bec.de@localhost> wrote:
> Subject: Re: Weirdness in comm(1)
> > 
> > I completely disagree.
> 
> I'm not at all comfortable with the introduction of EOVERFLOW to fgetln(3).
> 
> The ability to handle lines longer than INT_MAX is much more academic.

Let's ignore for a moment whether the limit is INT_MAX or SIZE_MAX.
fgetln does have a platform specific limit due to the amount of memory.

Imagine that fgetln uses a very smart lookup algorithm in the backend.
It can be imagined that it might know the length of the line without
reading it to memory completely or that it is using a compressed buffer
or whatever. For this reason documenting that this can result in an
error is a good way anyway.

I will fix the size_t vs int, but that's a separate question.

Joerg


Home | Main Index | Thread Index | Old Index