Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!MCIRPS2.MED.NYU.EDU!root From: root@MCIRPS2.MED.NYU.EDU Newsgroups: comp.sys.sgi Subject: Timeout on serial port read Message-ID: <9005021809.AA29051@mcirps2.med.nyu.edu> Date: 3 May 90 04:34:06 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 34 X-Unparsable-Date: Wed, 2 May 90 11:09:29 DSD I am trying to set the ioctl call so that a raw read from a serial port will time out after a few seconds. No matter what I set the TIME value for in the control structure, the machine still hangs waiting for characters. What am I doing wrong, if anything. Code follows: --- new_settings.c_iflag = IGNBRK | IGNPAR; new_settings.c_oflag = NULL; new_settings.c_cflag = B9600 | CS8 | CREAD | CLOCAL; new_settings.c_lflag = ICANON; new_settings.c_line = NULL; new_settings.c_cc[0] = NULL; new_settings.c_cc[1] = NULL; new_settings.c_cc[2] = NULL; new_settings.c_cc[3] = NULL; new_settings.c_cc[4] = NULL; new_settings.c_cc[5] = TIMEOUT; ioctl(fd, TCSETA, &new_settings); ----- A read that has timed out should return with a value of 0. Right ? dan. -- +-----------------------------------------------------------------------------+ | karron@nyu.edu Dan Karron | | . . . . . . . . . . . . . . New York University Medical Center | | 560 First Avenue \ \ Pager <1> (212) 397 9330 | | New York, New York 10016 \**\ <2> 10896 <3> | | (212) 340 5210 \**\__________________________________________ | +-----------------------------------------------------------------------------+