From owner-freebsd-arch@FreeBSD.ORG Thu Nov 10 02:21:35 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 74CA7106564A; Thu, 10 Nov 2011 02:21:35 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 310068FC08; Thu, 10 Nov 2011 02:21:34 +0000 (UTC) Received: by iakl21 with SMTP id l21so1042642iak.13 for ; Wed, 09 Nov 2011 18:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=HTHDWi5rIr1qtU1KERsTgOoqjNUYB9/lR1D3Coj+fUc=; b=ND/fpI+7m7zZ7H2xNb9AuynTGT4iP00I2wQud7M05/xerqgu8ccpzVZezteEapI5XA kIBBqCK5IiJd0+zsgiKQZEz6S4fIJF+Gt20jTDwLj6BmsbEKDROewAAAWHVYnG+eZmrh 56x6aVuRizG2TaIUGwM1/5G6uidg76jQelKPo= Received: by 10.231.82.11 with SMTP id z11mr1242707ibk.77.1320889928932; Wed, 09 Nov 2011 17:52:08 -0800 (PST) Received: from kruse-180.4.ixsystems.com (drawbridge.ixsystems.com. [206.40.55.65]) by mx.google.com with ESMTPS id jm11sm9270928ibb.1.2011.11.09.17.52.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 17:52:07 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: Date: Wed, 9 Nov 2011 17:52:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Peter Wemm X-Mailer: Apple Mail (2.1084) 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 02:21:35 -0000 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. >>=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. Move to a compat library perhaps? -Garrett=