Date: Tue, 12 Mar 1996 09:03:03 -0500 From: "Brian J. McGovern" <mcgovern@spoon.beta.com> To: questions@freebsd.org Subject: Last of the ioctl questions... Message-ID: <199603121403.JAA02030@spoon.beta.com>
next in thread | raw e-mail | index | archive | help
Ok. Almost think I got it. Just a couple of more questions. 1.) The two calls - TIOCSTI and TIOCCONS. I can get TIOCSTI to work when I'm root. Is it possible to make it work for a non-root user who has the port open? With TIOCCONS, I've yet been able to make it work, even as root. What conditions must be met for a program to be able to redirect console output? 2.) When opening a tty device for outbound communications (ie - local host is initiating the communication), I call open with O_RDWR | O_NONBLOCK. For inbound, I open it with just O_RDWR. I then call a TIOCEXCL ioctl to "lock" the port so that no one else can open it. I then call TIOCNXCL before the close() to free it. Is this the correct method, or is there a "more correct" method for locking the device. Thanks, as always, Brian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603121403.JAA02030>