From owner-freebsd-hackers Fri Mar 2 7: 6:51 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from cyclone.eis.ru (for.spb.ru [195.201.69.16]) by hub.freebsd.org (Postfix) with SMTP id 82C1537B71A for ; Fri, 2 Mar 2001 07:06:29 -0800 (PST) (envelope-from diwil@eis.ru) Received: (qmail 90525 invoked from network); 2 Mar 2001 15:15:16 -0000 Received: from good.for.spb.ru (HELO runnet-gw.marketsite.ru) (195.201.69.80) by for.spb.ru with SMTP; 2 Mar 2001 15:15:16 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Fri, 02 Mar 2001 18:02:56 +0300 (MSK) Reply-To: diwil@eis.ru From: Dmitry Dicky To: freebsd-hackers@freebsd.org Subject: stupid device driver question Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi fellows, I'm writing some device driver which should pass some data to the user space. The part of the device read routine looks as follows: ---------------------------------- int dev_read(dev_t dev, struct uio *uio, int ioflag) { int err = 0; /* ... */ amnt = MIN(uio->uio_resid, cntw); /* Wait here until data available .... how? */ err = uiomove(buf2, amnt, uio); if (err != 0) { return(err); } memset(buf2, 0, amnt); cntw -= amnt; return 0; } ------------------------------------- User application hands on read(2). But buf2 being filled upon some event and 'dev_read' should wait until data in buf2 available. So, the question is: How can I hang dev_read, issue some signal and then continue uiomove(9) data to the user space? Thanks in advance, D. -- ********************************************************************* ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3148860, 5585314 ********************************************************************* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message