From owner-freebsd-arch@FreeBSD.ORG Thu Nov 10 03:18:29 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 329131065670 for ; Thu, 10 Nov 2011 03:18:29 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 137D78FC12 for ; Thu, 10 Nov 2011 03:18:28 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id A64E41A3C3B; Wed, 9 Nov 2011 19:18:28 -0800 (PST) Date: Wed, 9 Nov 2011 19:18:28 -0800 From: Alfred Perlstein To: Garrett Cooper Message-ID: <20111110031828.GC6110@elvis.mu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: 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 03:18:29 -0000 This just reeks of gratuitous breakage. Sure it's marked depricated, but there's little reason to break a ton of applications just to remove 11 lines of code. Maybe we can put it under an ifndef IVORY_TOWER. -Alfred * Garrett Cooper [111109 18:22] wrote: > On Nov 9, 2011, at 4:49 PM, Peter Wemm wrote: > > > 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. > >> > >> -- > >> Gianni > >> > >> ================================= > >> --- 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 = fgetown(&mpipe->pipe_sigio); > >> break; > >> > >> - /* This is deprecated, FIOSETOWN should be used instead. */ > >> - case TIOCSPGRP: > >> - PIPE_UNLOCK(mpipe); > >> - error = fsetown(-(*(int *)data), &mpipe->pipe_sigio); > >> - goto out_unlocked; > >> - > >> - /* This is deprecated, FIOGETOWN should be used instead. */ > >> - case TIOCGPGRP: > >> - *(int *)data = -fgetown(&mpipe->pipe_sigio); > >> - break; > >> - > >> default: > >> error = ENOTTY; > > > > 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. > > > > You might also want to consider things like this in libc: > > int > > tcsetpgrp(int fd, pid_t pgrp) > > { > > int s; > > > > s = pgrp; > > return (_ioctl(fd, TIOCSPGRP, &s)); > > } > > Our own libc code uses this, albeit on an API intended to be used on a tty. > > > > 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. > > > > It might also be an idea to see if the linux compat layer can be > > switched over to using the newer API. > > 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" -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer