Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2011 21:47:30 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Alfred Perlstein <alfred@freebsd.org>
Cc:        Garrett Cooper <yanegomi@gmail.com>, Giovanni Trematerra <gianni@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: deprecated TIOCSPGRP and TIOCGPGRP ioctl command
Message-ID:  <5CCE304D-FF92-45F1-8D1F-7B9EA224E417@bsdimp.com>
In-Reply-To: <20111110031828.GC6110@elvis.mu.org>
References:  <CACfq09210zdar=%2BM40gLoVtZnwLda88T1FJBbLXiy9e3t8-9NQ@mail.gmail.com> <CAGE5yCor9c%2Bb7hZaF8NLdxc2F8PPfi0kTZFLXY5nvA%2Bbm1Ytuw@mail.gmail.com> <D2F25708-5E0B-4270-83F0-79286C5A581A@gmail.com> <20111110031828.GC6110@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I tend to agree: aren't there more pressing problems in the project that =
will solve actual problems rather than create a lot of work to save a =
tiny number of bytes in the object code.

Warner

On Nov 9, 2011, at 8:18 PM, Alfred Perlstein wrote:

> This just reeks of gratuitous breakage.  Sure it's=20
> marked depricated, but there's little reason to break a ton
> of applications just to remove 11 lines of code.
>=20
> Maybe we can put it under an ifndef IVORY_TOWER.
>=20
> -Alfred
>=20
> * Garrett Cooper <yanegomi@gmail.com> [111109 18:22] wrote:
>> On Nov 9, 2011, at 4:49 PM, Peter Wemm wrote:
>>=20
>>> On Wed, Nov 9, 2011 at 3:39 PM, Giovanni Trematerra =
<gianni@freebsd.org> wrote:
>>>> Are they deprecated enough to be removed, now?
>>>> FYI FIFO doesn't support them.
>>>>=20
>>>> --
>>>> Gianni
>>>>=20
>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>> --- sys/kern/sys_pipe.c (revision 227233)
>>>> +++ sys/kern/sys_pipe.c (working copy)
>>>> @@ -1304,17 +1304,6 @@ pipe_ioctl(fp, cmd, data, active_cred, td)
>>>>       *(int *)data =3D fgetown(&mpipe->pipe_sigio);
>>>>       break;
>>>>=20
>>>> -   /* This is deprecated, FIOSETOWN should be used instead. */
>>>> -   case TIOCSPGRP:
>>>> -       PIPE_UNLOCK(mpipe);
>>>> -       error =3D fsetown(-(*(int *)data), &mpipe->pipe_sigio);
>>>> -       goto out_unlocked;
>>>> -
>>>> -   /* This is deprecated, FIOGETOWN should be used instead. */
>>>> -   case TIOCGPGRP:
>>>> -       *(int *)data =3D -fgetown(&mpipe->pipe_sigio);
>>>> -       break;
>>>> -
>>>>   default:
>>>>       error =3D ENOTTY;
>>>=20
>>> Be very very careful with this.  It's part of the classic BSD job
>>> control API.  It would be wise to survey whether any ports shells =
use
>>> this.
>>>=20
>>> You might also want to consider things like this in libc:
>>> int
>>> tcsetpgrp(int fd, pid_t pgrp)
>>> {
>>>       int s;
>>>=20
>>>       s =3D pgrp;
>>>       return (_ioctl(fd, TIOCSPGRP, &s));
>>> }
>>> Our own libc code uses this, albeit on an API intended to be used on =
a tty.
>>>=20
>>> The shell I'd be most concerned about is csh/tcsh in our tree. It =
has
>>> quite an #ifdef legacy layer and I couldn't convince myself it =
wasn't
>>> using this indirectly (or the tc* functions) on pipes.
>>>=20
>>> It might also be an idea to see if the linux compat layer can be
>>> switched over to using the newer API.
>>=20
>> Move to a compat library perhaps?
>> -Garrett_______________________________________________
>> freebsd-arch@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
>> To unsubscribe, send any mail to =
"freebsd-arch-unsubscribe@freebsd.org"
>=20
> --=20
> - Alfred Perlstein
> .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10
> .- FreeBSD committer
> _______________________________________________
> freebsd-arch@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to =
"freebsd-arch-unsubscribe@freebsd.org"
>=20
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5CCE304D-FF92-45F1-8D1F-7B9EA224E417>