From owner-freebsd-hackers Wed Aug 5 06:52:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA17418 for freebsd-hackers-outgoing; Wed, 5 Aug 1998 06:52:13 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spoon.beta.com (mcgovern.ne.mediaone.net [24.128.106.170]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA17413 for ; Wed, 5 Aug 1998 06:52:11 -0700 (PDT) (envelope-from mcgovern@spoon.beta.com) Received: from spoon.beta.com (mcgovern@localhost [127.0.0.1]) by spoon.beta.com (8.8.8/8.8.8) with ESMTP id JAA28675 for ; Wed, 5 Aug 1998 09:51:58 -0400 (EDT) (envelope-from mcgovern@spoon.beta.com) Message-Id: <199808051351.JAA28675@spoon.beta.com> To: hackers@FreeBSD.ORG Subject: select() problem with new device driver... Date: Wed, 05 Aug 1998 09:51:58 -0400 From: "Brian J. McGovern" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I could probably figure this out with another day of dinking with DDD, but I'm sure someone on -hackers will have a quick answer. In an application, I'm opening up several device descriptors to modem ports (writing the driver for myself, as they're not 'normal' modems). I use the standard macros FD_ZERO, and FD_SET to zero my descriptor set, then set the bits. I the make a select() call with a NULL (no) timeout. When input comes in on a modem, I call ttwakeup in the driver, which appears to get around to calling selwakeup() to wake up anything sleeping on the read side. The _problem_ appears to be that between FD_ZERO, FD_SET, and the upper half of select() (I think its the latter), the t_rsel.si_pid isn't being set (its 0 when I look at it in the driver), and it appears selwakeup() needs a non-zero value in order to actually do anything. I suspect that this field not being set is due to something stupid I'm not doing in the driver, such as setting one of the TS_ flags in the t_state field, but I've yet to be able to find the portion of select() that actually handles this, so I can see what conditions it wants to proceed. Can anyone give me a pointer? Thanks. -Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message