Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: HELP PLEASE: select() in BSD Message-ID: <6444@brl-smoke.ARPA> Date: Sun, 20-Sep-87 21:18:18 EDT Article-I.D.: brl-smok.6444 Posted: Sun Sep 20 21:18:18 1987 Date-Received: Mon, 21-Sep-87 03:42:02 EDT References: <307@picuxa.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <307@picuxa.UUCP> gp@picuxa.UUCP (Greg Pasquariello X1190) writes: > According to an associate, there is a function in BSD called > select(). This function is similar to sleep(), except that > when awakened, the function can tell who or what woke it (i.e > another computer, a port, etc.). Does anyone no if there is > a similar function in System 5 V 3.1? If not, is there any > way to create one? Thanks in advance. (This question should have been posted to comp.unix.questions.) select() tests for activity on a specified set of read/write/exception file descriptors, with an optional timeout to abort the select() if no activity happens. The UNIX System V Release 3.0 (or later) equivalent is poll(), which is found in the Programmer's Reference Manual under POLL(2). Note that it works only with STREAMS files, and that not all devices that could be are STREAMS devices. In particular, the terminal handler is not (yet) a STREAMS device. To test for activity on a terminal, System V programs typically use MIN,TIME (described under TERMIO(7), usually in the Administrator's Reference Manual) or O_NDELAY mode (see READ(2) and WRITE(2)).