From owner-freebsd-current@FreeBSD.ORG Sat Aug 14 13:26:30 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 19A021065674; Sat, 14 Aug 2010 13:26:30 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id D6B008FC13; Sat, 14 Aug 2010 13:26:29 +0000 (UTC) Received: from terminus.farley.org (terminus.farley.org [192.168.1.205]) by mail.farley.org (8.14.4/8.14.4) with ESMTP id o7EDPvCX042821; Sat, 14 Aug 2010 08:25:58 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Sat, 14 Aug 2010 08:25:57 -0500 (CDT) From: "Sean C. Farley" To: "Julian H. Stacey" In-Reply-To: <201008141040.o7EAeiuR093012@fire.js.berklix.net> Message-ID: References: <201008141040.o7EAeiuR093012@fire.js.berklix.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Spam-Status: No, score=-2.9 required=4.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.farley.org Cc: 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 13:26:30 -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(). Sean -- scf@FreeBSD.org