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
--
s...@freebsd.org
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to