From owner-freebsd-hackers@FreeBSD.ORG Tue May 25 09:02:36 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C741065675 for ; Tue, 25 May 2010 09:02:36 +0000 (UTC) (envelope-from krivenok.dmitry@gmail.com) Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by mx1.freebsd.org (Postfix) with ESMTP id 77A9D8FC1A for ; Tue, 25 May 2010 09:02:36 +0000 (UTC) Received: by ewy1 with SMTP id 1so394104ewy.13 for ; Tue, 25 May 2010 02:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=bSttJH/j0gqezCeD74ti1BgRxEjZ9Tdeqr3CUl1nxko=; b=EUOMnZ/ZVBbJl4OPeqhaLyD84YHAVLMP9MGBnVmmKyZVjynQNlc0wecGAkuEPAWiP4 D3dUlto6pH9E20N9Ks/ll8Z9Iz9zgpPg7RyfX3Kt12Q+sEQKcz+T/IXASrbFvMk7dSks LRf1anGOLW5nnM1vPYaMjk/C/0dLK+N9OBNGs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=E1sEqLRhZrvZqliFga5sU50sUy1SSyUoNV+Ah/drC+3C8chQV4h0nlXIa9OBZwyqq6 MDqSmObCYaxJUPCJL+WAY9jLwz8p1+bdnTcYjqsZVglzzNtWaQQFRp+oFQLU5fS4wXFC 4WjKCJErnFw7AU6PdQ4sEbzLQtUFeuZNs/LO4= MIME-Version: 1.0 Received: by 10.213.19.14 with SMTP id y14mr332783eba.29.1274778155298; Tue, 25 May 2010 02:02:35 -0700 (PDT) Received: by 10.213.11.2 with HTTP; Tue, 25 May 2010 02:02:35 -0700 (PDT) Date: Tue, 25 May 2010 13:02:35 +0400 Message-ID: From: Dmitry Krivenok To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: select/poll for sockets in kernel space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 09:02:37 -0000 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