Date: Sun, 7 Apr 1996 11:18:32 +0200 From: Thomas Roell <roell@blah.a.isar.de> To: Terry Lambert <terry@lambert.org> Cc: roell@blah.a.isar.de (Thomas Roell), hackers@FreeBSD.org, jkh@time.cdrom.com, roell@xinside.com Subject: Re: The F_SETOWN problem.. Message-ID: <199604070918.LAA00219@blah.a.isar.de> In-Reply-To: <199604070021.RAA28693@phaeton.artisoft.com> References: <199604060911.LAA00234@blah.a.isar.de> <199604070021.RAA28693@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604070918.LAA00219>