Xref: utzoo unix-pc.general:2215 comp.sys.att:5509 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!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! Summary: Correction! Message-ID: <601@icus.islp.ny.us> Date: 10 Feb 89 15:13:40 GMT References: <137@zebra.UUCP> <7411@chinet.chi.il.us> <10652@stb.UUCP> <599@icus.islp.ny.us> Reply-To: lenny@icus.islp.ny.us (Lenny Tropiano) Distribution: na Organization: ICUS Software Systems, Islip, New York Lines: 32 In article <599@icus.islp.ny.us> lenny@icus.islp.ny.us (Lenny Tropiano) writes: |> |>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... |> I guess next time I should look in the manual first. It's been a while since I did fcntl, and the "DIAGNOSTICS" section of the manual page fcntl(2) says that the return value of F_GETFL is the file flags. Therefore there is *no* argument ... Thanks Mike, you enlightened me again :-) oflags = fcntl(fd, F_GETFL); if (oflags != -1) fcntl(fd, F_SETFL, oflags | O_NDELAY); -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