Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!garnett From: garnett@cs.utexas.edu (John William Garnett) Newsgroups: comp.sys.next Subject: pseudo-terminal programming question Keywords: pty pseudo tty NeXT Terminal Message-ID: <1574@dimebox.cs.utexas.edu> Date: 22 Jun 91 23:17:16 GMT Organization: UTexas CS Dept, Austin, Texas Lines: 25 I wish to use the pseudoterminal interface on the NeXT (e.g. /dev/ptyqa and /dev/ttyqa). I notice that Terminal uses pty's [when I type the who command, the terminal is listed as ttyp8 which is the slave side of a pty]. My question (#1) is: how can my application [which is written in C] choose a pty that isn't currently being used? I don't wish to use an arbitrary /dev/pty?? file because then I risk writing into a running Terminal window. Is there some locks directory or other reservation system for pty's? Question #2: once I have selected a pty that isn't being used, how do I reserve that pty so that some other application (possibly my own) doesn't attempt to use the pty (assuming that other application uses the answer to question #1 to check if the pty is in use). Responses via email are best. I'll summarize if anyone expresses interest in the answers. Thanks. -- John Garnett University of Texas at Austin garnett@cs.utexas.edu Department of Computer Science Austin, Texas