Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Mar 1997 19:54:32 -0800
From:      pius@ienet.com
To:        msmith@atrad.adelaide.edu.au
Cc:        sos@ravenock.cybercity.dk, hackers@FreeBSD.ORG, mark@quickweb.com
Subject:   Re: Linux JDK on 2.2
Message-ID:  <199703070354.TAA19401@iago.ienet.com>

next in thread | raw e-mail | index | archive | help

On Fri, 7 Mar 1997, msmith@atrad.adelaide.edu.au wrote:

> F_GETOWN   Get the process ID or process group currently receiving SIGIO
>            and SIGURG signals; process groups are returned as negative
>            values (arg is ignored).
>
> F_SETOWN   Set the process or process group to receive SIGIO and SIGURG
>            signals; process groups are specified by supplying arg as neg-
>            ative, otherwise arg is interpreted as a process ID.

Ok, I wasn't quite sure if these were directly related to FIOGETOWN/FIOSETOWN,
but now after closer examination of sys_generic.c (ioctl) and kern_descrip.c
(fcntl) in /usr/src/sys/kern, it appears to me that

	fcntl(fd, F_SETOWN, pid) is equivalent to
	ioctl(fd, FIOSETOWN, &pid) and

	pid = fcntl(fd, F_GETOWN, 0) is equivalent to
	ioctl(fd, FIOGETOWN, &pid)

Is that correct?

If that's the case, then the FIOGETOWN/FIOSETOWN ioctl's could be implemented
in linux_ioctl.c similarly to the way the F_GETOWN/F_SETOWN fcntl's are
currently implemented in linux_file.c - perhaps linux_fcntl could even be
called directly from linux_ioctl in these cases, but maybe that would be
considered inefficient.

In linux_file.c there's this comment in the linux_fcntl function:

    case LINUX_F_SETOWN:
    case LINUX_F_GETOWN:
        /*
         * We need to route around the normal fcntl() for these calls,
         * since it uses TIOC{G,S}PGRP, which is too restrictive for
         * Linux F_{G,S}ETOWN semantics. For sockets, this problem
         * does not exist.
         */

So, how are FreeBSD's F_{G,S}ETOWN semantics different from Linux's?

Ok, for sockets they're the same, but for ttys it appears that FreeBSD
requires that the tty is the current process's controlling terminal.
Is that how FreeBSD's semantics are more restrictive?

Regards,
Pius



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