Date: Sat, 6 Apr 1996 11:06:44 +0200 From: Thomas Roell <roell@blah.a.isar.de> To: hackers@FreeBSD.org, jkh@time.cdrom.com, roell@xinside.com Subject: Re: The F_SETOWN problem.. Message-ID: <199604060906.LAA00231@blah.a.isar.de> In-Reply-To: <29203.828776164@time.cdrom.com> References: <29203.828776164@time.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In your message of 5 April 1996 you write: > Bruce's reply.. I've sent out another message asking whether or not > we intend to actually make this work.. :-) Ok, I'll take this up to general discussion. > ------- Forwarded Message > > Replied: Fri, 05 Apr 1996 23:34:33 -0800 > Replied: "Bruce Evans <bde@zeta.org.au> hackers@FreeBSD.org" > Return-Path: bde@zeta.org.au > Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by time.cdrom.com (8.7.5/8.6.9) with SMTP id XAA29003 for <jkh@time.cdrom.com>; Fri, 5 Apr 1996 23:21:57 -0800 (PST) > Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id RAA14868; Sat, 6 Apr 1996 17:16:20 +1000 > Date: Sat, 6 Apr 1996 17:16:20 +1000 > From: Bruce Evans <bde@zeta.org.au> > Message-Id: <199604060716.RAA14868@godzilla.zeta.org.au> > To: hackers@FreeBSD.org, jkh@time.cdrom.com > Subject: Re: Any clues as to why this fails? > > >#include <signal.h> > >#include <fcntl.h> > > >void > >handler(int sig) > >{ > > printf("Signal %d received\n", sig); > >} > > >main() > >{ > > int i, fd; > > > signal(SIGIO, handler); > > > fd = open("/dev/cuaa1", O_RDONLY | O_NONBLOCK | O_EXCL); > > printf("%d\n", fd); > > i = fcntl(fd, F_GETFL, 0); > > printf("%d\n", i); > > printf("%d\n", fcntl(fd, F_SETFL, i | O_ASYNC)); > > printf("%d\n", fcntl(fd, F_SETOWN, getpid())); /* This call returns -1 */ > > pause(); > >} > > >I've read the man page for fcntl() and it really appears as though > >that F_SETOWN call should work. Any clues as to why not? This > > 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. To work like you want, F_SETOWN would need a separate pgrp > entries in the tty struct. Sockets work like you want because there is > no POSIX pgrp entry to conflict with. F_SETOWN doesn't work on anything > except ttys, sockets or perhaps pipes. To work as documented in fcntl.3, > F_SETOWN would need to have a pgrp entry in the filedesc struct. This > would probably be useful - it would allow sending SIGIO to arbitrary > sets of sufficiently privileged processes. Ok, then I had 2 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. 2) My -- 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?199604060906.LAA00231>