From owner-freebsd-arch@FreeBSD.ORG Thu Nov 10 04:47:49 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3823106566B; Thu, 10 Nov 2011 04:47:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4FBA38FC12; Thu, 10 Nov 2011 04:47:49 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pAA4lYEG013142 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 9 Nov 2011 21:47:36 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20111110031828.GC6110@elvis.mu.org> Date: Wed, 9 Nov 2011 21:47:30 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <5CCE304D-FF92-45F1-8D1F-7B9EA224E417@bsdimp.com> References: <20111110031828.GC6110@elvis.mu.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 09 Nov 2011 21:47:37 -0700 (MST) Cc: Garrett Cooper , Giovanni Trematerra , freebsd-arch@freebsd.org Subject: Re: deprecated TIOCSPGRP and TIOCGPGRP ioctl command X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 04:47:49 -0000 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 [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 = 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