Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfcdc!rer From: rer@hpfcdc.HP.COM (Rob Robason) Newsgroups: comp.sys.hp Subject: Re: why is TIOCNOTTY not defined? what is TIOCNOTTY? Message-ID: <5570279@hpfcdc.HP.COM> Date: 28 Aug 89 19:04:50 GMT References: <8709@batcomputer.tn.cornell.edu> Organization: HP Ft. Collins, Co. Lines: 35 > I notice that in my ioctl.h file (in /usr/include/sys) that the > definition for TIOCNOTTY is ifdef'ed out. Anybody know why? > I've built code, specifically the kip code for managing an > Appletalk network, that requires TIOCNOTTY by simply removing > the conditional ifdef, thus, making TIOCNOTTY defined. Everything > works. But I have to admit, I don't understand what's going > on here. Any light that can be shed on this issue would be > most appreciated. The BSD reference says: "A process can remove the association it has with its controlling terminal by opening the file /dev/tty and issuing an ioctl(f, TIOCNOTTY, 0); This is often desirable in server processes." This same function may be accomplished in HP-UX with setpgrp(2). I wouldn't bet that "Everything Works" in my application, if I were you. Terminal affiliation is pretty confusing, and there may be side effects you haven't noticed *yet*. If the function described above is what your application needs, I would suggest that you ifdef your code something like: #ifdef TIOCNOTTY ioctl(f, TIOCNOTTY, 0); #else setpgrp(); #endif Rob Robason