From owner-freebsd-hackers Sun Apr 7 01:35:58 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id BAA00806 for hackers-outgoing; Sun, 7 Apr 1996 01:35:58 -0800 (PST) Received: from blah.a.isar.de (root@blah.a.isar.de [194.45.233.130]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id BAA00784 for ; Sun, 7 Apr 1996 01:35:51 -0800 (PST) Received: (from roell@localhost) by blah.a.isar.de (8.6.12/8.6.9) id LAA00219; Sun, 7 Apr 1996 11:18:32 +0200 Date: Sun, 7 Apr 1996 11:18:32 +0200 From: Thomas Roell Message-Id: <199604070918.LAA00219@blah.a.isar.de> To: Terry Lambert Cc: roell@blah.a.isar.de (Thomas Roell), hackers@FreeBSD.org, jkh@time.cdrom.com, roell@xinside.com Subject: Re: The F_SETOWN problem.. In-Reply-To: <199604070021.RAA28693@phaeton.artisoft.com> References: <199604060911.LAA00234@blah.a.isar.de> <199604070021.RAA28693@phaeton.artisoft.com> Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk In your message of 6 April 1996 you write: > > Ok, then I had 2 or 3 maybe very stupid sounding questions (and believe me, > > I tried to work around them for quite a while now): > > > > 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. > > The question is wrong. > > The correct question is "how do I make this tty the controlling > tty for my process?". > > You are attempting to map in the wrong direction. I would say the basic question still is, how do I get a signal if there is new data on my serial port ? > The *ONLY* reliable way to get SIGHUP delivery on two or more ttys > is to use another process for each additional tty to act as the > controlling process and then use an IPC mechanism to send the signals > to the "master" process. This is what I kind of avoid. The whole idea with the SIGIO was process io asynchronously. If I have to spawn another process to handle this and use signals/ipc to deliver data to my real process the I have increased the responsiveness at the cost of another process hogging the scheduler. And since this sub-process would use select() to controll many tty lines it would not be as direct as with a signal. > Really, the entire idea of controlling ttys and signal delivery and > session and process and credential association is rather broken. > Unfortunately POSIX has cast it in stone and now we are all screwed > if we want to be standards compliant. 8-(. *sigh* SYSV (aehm really working since SVR4) allows my at least a ioctl(fd, I_SETSIG, S_INPUT) to register a SIGPOLL for each STREAMS device I want. This seems to be the solution that works best, and that does what I really want to have. - Thomas -- Denver Office THOMAS ROELL /\ Das Reh springt hoch, +1(303)298-7478 X INSIDE INC / \/\ das Reh springt weit, 1801 Broadway, Suite 1710 / \ \/\ was soll es tun, Denver, CO 80202 roell@xinside.com / Oelch! \ \ es hat ja Zeit.