Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!lwa@mit-csr From: lwa@mit-csr@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: Re: how do you time-out on a read? Message-ID: <3395@sri-arpa.UUCP> Date: Sat, 23-Jul-83 11:09:00 EDT Article-I.D.: sri-arpa.3395 Posted: Sat Jul 23 11:09:00 1983 Date-Received: Mon, 25-Jul-83 04:39:29 EDT Lines: 16 I use this scheme also, but there are a couple of potential problems that people should be aware of: 1) If you're using the Berkeley job-control stuff, the signal won't interrupt the read. This is a "feature" of the sigsys() system call. Note that any time you link against /usr/lib/libjobs.a, you get a version of the signal() routine which actually does a sigsys system call and hence gets you this feature whether you want it or not. (See the documentation in Jobs(III) in the 4.1 UPM). 2) There's a race condition between the alarm and the read call. If the alarm goes off between the time you set it and the time you do the read, you may sleep forever. In practice, this is only a problem with very short alarms (one or two seconds), but the problem does exist. -Larry Allen -------