bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] getline bug?


From: Paul Eggert
Subject: Re: [Bug-gnulib] getline bug?
Date: Tue, 05 Oct 2004 11:32:34 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden writes:

> In general I don't agree with the unlocked versions of the glibc
> functions being exposed.

I'm afraid that ship has already sailed, as POSIX (with the
Thread-Safe Functions extension) requires support for functions like
getc_unlocked.

> Couldn't glibc set a flag whether to
> use locking or not when pthread_create is called?

It could, yes, but even if glibc were modified to improve its
performance in that way, the problem would still remain on Solaris and
other OSes that have getc_unlocked, so unlocked-io.h would still be
useful on those platforms.

> Also I really think that coreutils/lib/linebuffer.c should use getline
> when available, as it's faster than even unlocked IO for any lines
> over 2 characters (and only slightly slower in that case).
> http://www.pixelbeat.org/linebuffer-2.0.21-getline.diff

I can't access that URL.

But before we head down that route, wouldn't it be better simply to
remove the linebuffer module and rewrite all its invokers to use
getline?  I don't see the point of the linebuffer module, to be
honest: I suspect it's just leftovers from ancient code that was
written before getline was available.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]