Richard L. Hamilton wrote: > Is TIOCNOTTY implemented or not? > > I see a couple of places where it appears in kernel code: > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/gentty.c#309 > where it appears to be explicitly _not_ done, > and > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/streamio.c#5674 > where it looks like it does get done. > > In the typical use, one applies that ioctl to /dev/tty to abandon the > association of a process from its controlling terminal. In that use, > would it encounter the streamio code first, i.e. would it work? > > It's easier and cleaner than some alternatives in certain situations...
Yes, it's implemented. The streamio.c strioctl() implementation is the real one. The gentty.c module is a red herring. It's part of the obscure "sy" driver ... which has no man page and dates back to the USL implementation. I have no idea what it does. :-/ For what it's worth, I would use fork()/setsid()/fork() to disclaim a controlling tty. It's simple and always works. (Though, notably, it does not get you outside of an existing contract, which is sometimes an important distinction for programs that operate as daemons.) -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code