Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!unido!tub!tmpmbx!uwbln!ckl From: ckl@uwbln.UUCP (Christoph Kuenkel) Newsgroups: comp.unix.wizards,sub.unix Subject: Re: I need a SysV select() Summary: no need to hack the kernel Message-ID: <992457@uwbull.uwbln.UUCP> Date: 26 May 88 14:41:46 GMT References: <9738@sol.ARPA> <843@tmpmbx.UUCP> Sender: ckl@uwbln.UUCP Distribution: comp,sub Organization: UniWare GmbH, Berlin Lines: 29 Posted: Thu May 26 15:41:46 1988 > jpayne@cs.rochester.edu (Jonathan Payne) writes: > {} > {} Hi. The simple version of my question is, is there an equivalent > {} function in SysV for BSD's select()? > {} If the answer is no, here's what I am trying to do. I want to get input > {} from either the keyboard or from some other file description. I don't > {} want to sit around polling the two, because that would be ridiculous. Is > {} there any reasonable way to do that on SysV? A blocking syscall blocks a process. so, if you like to wait for several events at the same time, you need several processes. a solution to your problem would be to fork off a watchdog that reads the keyboard and signals his daddy when input arrives. the parent may then collect what had been read using system V ipc (msges, fifos or whatever). this works quite good unless interrupted system call are a problem. also note that signals may get lost in system 5 (upto rel 2). if your have several input sources, you should setup a watchdog for any source and establish something like a protocol between the watchdogs and the main process. the watchdogs would then send requests to the main proc containing the data received. the main process would block on a single input queue only. if tty input is the most interesting thing, you should modify the watchdog so that it only reads from the tty when requested by the main process. the main process would do a time-out read from the tty and accept watchdog input only if a time-out occured.