Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 May 2010 13:02:35 +0400
From:      Dmitry Krivenok <krivenok.dmitry@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   select/poll for sockets in kernel space
Message-ID:  <AANLkTimTGjiEolesEOMN6Zdo-wjmuT5nFDzbHYk_-sI1@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello Hackers!

I'm developing a module for FreeBSD-8 and encountered the problem with
polling sockets.
I know that FreeBSD-8 kernel provides 3 interfaces for polling
(kern/sys_generic.c):
1) kern_select
2) poll
3) selsocket

I cannot use first two interfaces because I have an array of sockets
(struct socket) created using socreate, i.e. I don't have file
descriptors.
I also cannot use selsocket because it doesn't tell me which events
fired and takes only one socket (but I have an array of sockets).

The problem is that the module I'm developing should work on
unmodified FreeBSD-8 kernel.
So I cannot just add new functionality suitable for my task in
kern/sys_generic.c.
I also cannot implement such functionality in the module itself
because select/poll implementation is hidden and only limited number
of interfaces is available to the rest
of the kernel (which is generally good, but not in my case :)).

Is it possible to solve my problem using existing kernel functionality?
Any suggestions are welcome!

Thanks in advance!

P.S.
I know about kqueue, but I have to use select/poll is this task.

-- 
Sincerely yours, Dmitry V. Krivenok
e-mail: krivenok.dmitry@gmail.com
skype: krivenok_dmitry
jabber: krivenok_dmitry@jabber.ru
icq: 242-526-443



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimTGjiEolesEOMN6Zdo-wjmuT5nFDzbHYk_-sI1>