From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,add77aa86b7e6d44,start X-Google-Attributes: gidfee84,public From: orel@dxunk1 (Oleg Orel) Subject: xxselect? Who did that already on OSF1? I think nobody... Date: 1996/08/11 Message-ID: #1/1 X-Deja-AN: 173523687 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: dxunk1.cern.ch organization: CERN European Lab for Particle Physics newsgroups: comp.unix.osf.osf1 I working for HIPPI device driver for OSF/1 3.2C (today). My problem is that when xxselect called first time and device nothing have to read in this case according to description in the OSF/1 books I should call select_enqueue(...). Afterwords, in my interrupt handler I can call ether select_dequeue ether select_wakeup. In second case xxselect will be called second time with revents=NULL (it's mean that I can't set it to indicate that something aviable for read/write) and in all cases user's level select interface returns -1. If timeout expired select returns 0. But I should return 1 to user level for indicate that whereis something for read. What is way for do that. Maybe you have examples of another drivers which do same? Here is C's explanation (it's of course extracted part of driver): typedef struct { sel_queue_t queue; ihandler_id_t *ihandler; struct controller *_controller; } HPI_KCONFIG; hpi_select(dev_t dev, short *events, short *revents, int scanning) { int unit=minor(dev); extern int hz; if (!scanning) { select_dequeue(&KCONFIG.queue); return(0); } /* Waiting for done in destionation */ if ((*events & POLLNORM) && (ICONFIG.type==HPI_DESTINATION)) { if ((!ICONFIG.transfer && !ICONFIG.done) || ICONFIG.error) return (-1); if (!ICONFIG.done) select_enqueue(&KCONFIG.queue); if (ICONFIG.done) *revents|= POLLNORM; } return (0); } hpi_intr(caddr_t _unit) { int unit=(int)_unit; String s; ICONFIG.interrupt++; if (ICONFIG.debug) printf("HCSR(%d)=%X\n",unit,*(int*)HCSR); if (ICONFIG.type==HPI_SOURCE) { if (HCSR->canceled_by_destination) { ICONFIG.error=HPI_CBDST; ICONFIG.transfer=0; ICONFIG.done=0; call_handler(unit); hpi_wakeup(unit); return clear_intr(unit); } } else { if (HCSR->last_connection_end) { ICONFIG.transfer=0; ICONFIG.done=1; ICONFIG.error=0; hpi_wakeup(unit); call_handler(unit); clear_intr(unit); return; } } } hpi_wakeup(int unit) { wakeup((caddr_t)&ICONFIG.sleep); select_wakeup(&KCONFIG.queue); } So... question is how to organize return value = 1 in user's level after select_enqueue before timeout. Now it's return -1 Thanks for you help, Oleg Orel