Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!goya!ai.mit.edu From: tmb@ai.mit.edu (Thomas M. Breuel) Newsgroups: comp.windows.x Subject: unix System V Message-ID: <8906021126.AA04281@wheat-chex.ai.mit.edu> Date: 2 Jun 89 11:26:24 GMT Sender: newsadm@goya.dit.upm.es Lines: 30 To: velayos (M. del Mar Palazuelos) In-Reply-To: velayos@bosco.dit.upm.es's message of 1 Jun 89 10:48:53 GMT Status: RO From: velayos@bosco.dit.upm.es (M. del Mar Palazuelos) Newsgroups: comp.windows.x Date: 1 Jun 89 10:48:53 GMT Reply-To: velayos@bosco.dit.upm.es (M. del Mar Palazuelos) Organization: Dept. Ingenieria de Sistemas Telematicos, dit, upm, Madrid, Spain We are working with Compac 386 using X-window version 11 release III and unix system V of Interactive. When we use AtAddInput over a pipe there is an error "select failed" with "ERRNO = ENO TTY". The select used is from libnet.a provided by X-windows, because in System V there is not select instruction. Can you help me? You lose. System V doesn't have a general way of implementing a select() function that works on all possible kinds of file descriptors (there is no "real" non-blocking I/O, i.e., something that would let you distinguish EOF from no-data-available, and there is no general way of finding out how much data is available on a file descriptor). In fact, I would strongly recommend not using the select() function in any Xlib provided for System V systems because you don't know what or how much they did implement. A hack to get around this problem is to do a read() on the file descriptor you are interested in and use an alarm() call to time out after a second if there is no data. The granularity isn't great, but it works well enough if you don't do it on more than one or two file descriptors.