kern/55007: btoken close() on kqueue filter descriptors.

Roman Nikitchenko hc at
Tue Jul 29 03:00:35 PDT 2003

>Number:         55007
>Category:       kern
>Synopsis:       btoken close() on kqueue filter descriptors.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 29 03:00:32 PDT 2003
>Originator:     Roman Nikitchenko
>Release:        FreeBSD 4.8-STABLE i386
Trifle Co. Ltd.
System: FreeBSD 4.8-STABLE FreeBSD 4.8-STABLE #0: Mon Jul 28 18:51:32 EEST 2003 hc at i386
    File descriptors obtained through kqueue() call can't be closed using
    uthread_close() because of non-libc_r kqueue() implementation and
    _thread_fd_table checks on uthread_close(). I see this behaviour after
    checks in /usr/src/lib/libc_r/uthread/uthread_close.c in the
    following branches:
    MAIN: after revision 1.14, RELENG_4_8_BP after revision
    Link against libc_r anything like this:

	int poller = kqueue();
	if ( close( poller ) < 0 )
	    perror( "close" );
    Write uthread_kqueue() function inserting new kqueue() descriptor into
    _thread_fd_table (maybe better way exists, but this is all i found).

    As workaround: syscall( SYS_close, fd ), but this is too dirty.


More information about the freebsd-bugs mailing list