From owner-freebsd-current@FreeBSD.ORG Sat Aug 14 15:24:00 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83D291065675; Sat, 14 Aug 2010 15:23:59 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.16.84]) by mx1.freebsd.org (Postfix) with ESMTP id 349368FC0A; Sat, 14 Aug 2010 15:23:58 +0000 (UTC) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by kabab.cs.huji.ac.il with esmtp id 1OkIaR-00086E-Em; Sat, 14 Aug 2010 18:23:55 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: "Sean C. Farley" In-reply-to: References: <201008141040.o7EAeiuR093012@fire.js.berklix.net> Comments: In-reply-to "Sean C. Farley" message dated "Sat, 14 Aug 2010 08:25:57 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 14 Aug 2010 18:23:55 +0300 From: Daniel Braniss Message-ID: Cc: "Julian H. Stacey" , Gabor Kovesdan , current@FreeBSD.org Subject: Re: Official request: Please make GNU grep the default X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2010 15:24:00 -0000 > 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(). let me rephrase the question: why would you want to lock a file for reading anyways?? there is no real benefit that I can see in locking a file for searching a pattern. On a single file the overhead is irrelevant, but for 'grep -r?' cheers, danny