From owner-freebsd-hackers Sat Apr 6 03:02:59 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA22675 for hackers-outgoing; Sat, 6 Apr 1996 03:02:59 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA22668 for ; Sat, 6 Apr 1996 03:02:56 -0800 (PST) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id NAA11280; Sat, 6 Apr 1996 13:02:43 +0200 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id NAA18557; Sat, 6 Apr 1996 13:02:42 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.4/8.6.9) id MAA24499; Sat, 6 Apr 1996 12:57:39 +0200 (MET DST) From: J Wunsch Message-Id: <199604061057.MAA24499@uriah.heep.sax.de> Subject: Re: The F_SETOWN problem.. To: roell@blah.a.isar.de (Thomas Roell) Date: Sat, 6 Apr 1996 12:57:37 +0200 (MET DST) Cc: hackers@FreeBSD.org, jkh@time.cdrom.com, roell@xinside.com Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199604060911.LAA00234@blah.a.isar.de> from "Thomas Roell" at Apr 6, 96 11:11:14 am X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk As Thomas Roell wrote: > > F_SETOWN on a tty only works for controlling terminals. This is because > > F_SETOWN is implemented as tcsetpgrp() and tcsetpgrp() is specified by > > POSIX. > 1) How do I get my process to be the controlling pgrp of this tty ? I > tried all things that worked under SVR4, but I'm lost on this one. > Just a couple of sample code lines would help me here incredible. See my other example (you might have missed it, i've sent it to freebsd-hackers). Basically, after #include'ing the appropriate headers: fork() -> exit the parent setsid() ioctl(fd, TIOCSCTTY, NULL) I doubt this is what you want :), don't you think polling with select() would be easier? > 2) Can my progress have two controlling ttys ? Of course not. > 3) Since this process has opened already a virutal terminal, he is > recieving signals for VT switching. Now if I would detach this one > from being the controlling tty and move the controlling tty to > /dev/cuaa1, would I still get those signals ? Of course not. But you would see the SIGHUP caused by unplugging the mouse. =:) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)