Email List: Xaustin-group-lX
[All Lists]

Re: fgets/strtok and LINE_MAX

To: austin-group-l@xxxxxxxxxxxxx
Subject: Re: fgets/strtok and LINE_MAX
From: Geoff Clare <gwc@xxxxxxxxxxxxx>
Date: Wed, 11 Nov 2009 10:14:31 +0000
References: <8a9f45f6fd0ea0d60344880e4f6cebba@austingroupbugs.net>
[Please can folks stop adding notes to bug 177 about fgets() and
LINE_MAX.  Bug 177 is about a minor issue in the strtok() example,
it is not the place to discuss the wider LINE_MAX issue.]

> ---------------------------------------------------------------------- 
>  (0000295) Konrad_Schwarz (reporter) - 2009-11-11 09:09
>  http://austingroupbugs.net/view.php?id=177#c295 
> ---------------------------------------------------------------------- 
> Honestly, I think that making LINE_MAX (and similar values) a run-time
> increasable value is just not worth it.
> 
> It turns these simple examples into non-trivial exercises, obscuring the
> point these examples intend to make.  The same holds for applications that
> wish to conform to POSIX: they are bogged down trying to fulfill all these
> requirements, with little gain for the user.
> 
> If vendors wish to add this feature to their systems, fine.  However,
> requiring applications to cope with all this stuff decreases the viability
> of POSIX, in my view. 

I don't see that it makes much difference to applications.  If
LINE_MAX was a fixed value in <limits.h> and not obtainable from
sysconf(), applications would still need to cope with huge values
such as LINE_MAX==LONG_MAX somehow.  They can cope with a -1 return
from sysconf() in the same way.

-- 
Geoff Clare <g.clare@opengroup.org>
The Open Group, Thames Tower, Station Road, Reading, RG1 1LX, England

<Prev in Thread] Current Thread [Next in Thread>