Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 1995 08:56:12 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, pst@cisco.com, stu@cisco.com
Cc:        hackers@freebsd.org
Subject:   Re: FleeBSD and XNTPD
Message-ID:  <199510092256.IAA27162@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510092256.IAA27162>