From owner-freebsd-hackers Mon Oct 9 16:01:01 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA27340 for hackers-outgoing; Mon, 9 Oct 1995 16:01:01 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA27335 for ; Mon, 9 Oct 1995 16:00:55 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id IAA27162; Tue, 10 Oct 1995 08:56:12 +1000 Date: Tue, 10 Oct 1995 08:56:12 +1000 From: Bruce Evans Message-Id: <199510092256.IAA27162@godzilla.zeta.org.au> To: bde@zeta.org.au, pst@cisco.com, stu@cisco.com Subject: Re: FleeBSD and XNTPD Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org Precedence: bulk >>FSETOWN has never worked "right" for ttys in FreeBSD releases. It only >>works for controlling terminals that are associated with the session of >>the calling process. Using it may interfere with normal controlling >Agreed but doesn't this apply to terminal devices to which there is already >attached a controlling terminal ? In this instance there is nothing >hanging on the terminal device at all - ie no login shell or similar. >Shouldn't the >rejection of the attempt be made iff there is already a process marked as the >controlling process ? There must be a controlling process for tcsetpgrp() to work. F_SETOWN shouldn't interfere with tcsetpgrp(). (I'd like F_SETOWN to be completely independent of the controlling terminal and its process[group]. Since F_SETOWN applies to file descriptors, I would expect the process[group] to be per-fd. Is that too general?) >See above - how would a process get itself marked as the recipient of the >signal without being able to use F_SETMODE or TICGSPGP (both of which >should map to the same thing) ? It can't be done that way. Under FreeBSD, the following all seems to be necessary: setsid(); ioctl(fd, TIOCSCTTY); fcntl(fd, F_SETOWN, getpid()); fl = fcntl(fd, F_GETFL); fcntl(fd, F_SETFL, fl | O_ASYNC); Plus error checking and setting up the signal handler of course. Bruce