Change select(2) to kevent(2) on script(1)...

Garrett Cooper yanefbsd at
Mon Dec 22 20:15:45 UTC 2008

On 12/22/08, Antoine Brodin <antoine at> wrote:
> On Mon, Dec 22, 2008 at 4:29 PM, Norikatsu Shigemura <nork at>
> wrote:
>>        I think that performance improvement is significant(I don't
>>        think performance improved by my patch).  But my patch is the
>>        first implementation of kqueue/kevent support for TTY.
>>        In fact, I could find a bug.  I hope to commit my patch.  But
>>        by performance reason, my patch is not accepted, I have no
>>        problem.
> Hi,
> Could you make it a compile time option, similar to the USE_KQUEUE
> option in make(1) ?
> I had to write something similar to script(1) for work recently, that
> ran on linux, and the freebsd sources were quite useful.
> Cheers,
> Antoine

Would partitioning out the select(2) code and #ifdef'ing it to mux
between the kevent(2) and select(2) interfaces be a prudent measure to
follow? The select(2) interface is essentially fixed now, so unless
POSIX changes that section of code shouldn't change. Any and all
advancements forward could be using the kevent(2) method, as long as
it's time permitting and the win / cost ratio is sufficiently high
enough to warrant it.

The fun part will be regression testing -_-.


More information about the freebsd-current mailing list