Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Aug 2010 08:25:57 -0500 (CDT)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        "Julian H. Stacey" <jhs@berklix.com>
Cc:        Gabor Kovesdan <gabor@FreeBSD.org>, current@FreeBSD.org
Subject:   Re: Official request: Please make GNU grep the default
Message-ID:  <alpine.BSF.2.00.1008140802510.35204@thor.farley.org>
In-Reply-To: <201008141040.o7EAeiuR093012@fire.js.berklix.net>
References:  <201008141040.o7EAeiuR093012@fire.js.berklix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Aug 2010, Julian H. Stacey wrote:

>> why would you want to lock a file for reading anyways?
>
> Does current bsdgrep read lock by default ?
> If so, it would be better off by default, enabled by an option.
> 8.0-RELEASE man grep (gnu) does not mention locking.

bsdgrep in -current does lock via the call to fgetc().  That is why I 
suggested using flockfile/getchar_unlocked+/funlockfile instead.  Other 
unlocked functions would also be useful, i.e., feof_unlocked(). 
Avoiding fgetc() does not completely solve the speed issue, yet it 
certainly helps.

Just for reference:  older bsdgrep used fgetln().

Sean
-- 
scf@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1008140802510.35204>