Xref: utzoo unix-pc.general:2014 comp.sys.att:5138 Path: utzoo!utgpu!watmath!clyde!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: termio(7) and read(2) problem! Message-ID: <7411@chinet.chi.il.us> Date: 9 Jan 89 16:40:49 GMT References: <137@zebra.UUCP> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Distribution: na Organization: Chinet - Public Access Unix Lines: 15 In article <137@zebra.UUCP> vern@zebra.UUCP (Vernon C. Hoxie) writes: > > I have been trying to write a test program for a Trailblazer. >It is connected to /dev/tty000. The program opens this file with: > > fd = open("/dev/tty000", O_RDWR | O_NDELAY); You probably need to use fcntl() to turn off the O_NDELAY before trying to use the port (set CLOCAL first if you need it). Write()s don't wait for the hardware to be ready if you leave O_NDELAY set and strange things happen. I have seen code that indicated that a close(open(/dev/ttywhatever,2) was needed to force the mode to changed. Does anyone know which versions of unix require this? Les Mikesell