Xref: utzoo unix-pc.general:2212 comp.sys.att:5500 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!rutgers!att!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: termio(7) and read(2) problem! Message-ID: <599@icus.islp.ny.us> Date: 10 Feb 89 04:50:14 GMT References: <137@zebra.UUCP> <7411@chinet.chi.il.us> <10652@stb.UUCP> Reply-To: lenny@icus.islp.ny.us (Lenny Tropiano) Distribution: na Organization: ICUS Software Systems, Islip, New York Lines: 36 In article <10652@stb.UUCP> michael@stb.UUCP (Michael) writes: |>In article <7411@chinet.chi.il.us> les@chinet.chi.il.us (Leslie Mikesell) writes: |>>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 ... |> |>Does anyone know how to turn ON NDELAY for an already open file? |> Michael ... Use the fcntl(2) system call. #include int oflags; /* assume a file descriptor (fd) is already open and in use */ ... fcntl(fd, F_GETFL, &oflags); /* get the current open flags */ /* set the flags to have O_NDELAY too */ fcntl(fd, F_SETFL, oflags | O_NDELAY); I assume that would do it for ya... -Lenny -- Lenny Tropiano ICUS Software Systems [w] +1 (516) 582-5525 lenny@icus.islp.ny.us Telex; 154232428 ICUS [h] +1 (516) 968-8576 {talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny attmail!icus!lenny ICUS Software Systems -- PO Box 1; Islip Terrace, NY 11752