From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EMACS_GET_TTY_PGRP vs. emacs_get_tty_pgrp Date: Wed, 20 Oct 2010 22:21:12 +0200 Message-ID: <83y69s8vk7.fsf@gnu.org> References: <4CBEFB15.5050303@cornell.edu> <4CBF4AA6.3000200@cornell.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1287606085 5255 80.91.229.12 (20 Oct 2010 20:21:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2010 20:21:25 +0000 (UTC) Cc: dann@gnu.org, emacs-devel@gnu.org To: Ken Brown Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 20 22:21:22 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8f9z-0005sS-1Y for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2010 22:21:19 +0200 Original-Received: from localhost ([127.0.0.1]:46515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8f9y-0002l9-Dh for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2010 16:21:18 -0400 Original-Received: from [140.186.70.92] (port=49495 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8f9s-0002kd-S5 for emacs-devel@gnu.org; Wed, 20 Oct 2010 16:21:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8f9p-00089M-Jr for emacs-devel@gnu.org; Wed, 20 Oct 2010 16:21:12 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:35105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8f9n-00088l-RI; Wed, 20 Oct 2010 16:21:08 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LAL00000V0FYJ00@a-mtaout20.012.net.il>; Wed, 20 Oct 2010 22:21:06 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.93.189]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LAL000NHV74V630@a-mtaout20.012.net.il>; Wed, 20 Oct 2010 22:21:06 +0200 (IST) In-reply-to: <4CBF4AA6.3000200@cornell.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131909 Archived-At: > Date: Wed, 20 Oct 2010 16:01:42 -0400 > From: Ken Brown > Cc: emacs-devel > > But then I still think emacs_get_tty_pgrp in process.c should be changed > so that it works on systems that have tcgetpgrp but not TIOCGPGRP. How > would you recommend handling this? Is it necessary to use conditional > code as in the emacs-23 definition of EMACS_GET_TTY_PGRP, or is it safe > to just always use tcgetpgrp as in the trunk's version of > EMACS_GET_TTY_PGRP? I would suggest to use TIOCGPGRP (inside emacs_get_tty_pgrp) if it's available, because at least on some systems it allows to access file descriptors of processes other than the current one, while tcgetpgrp does not. Please note that emacs_get_tty_pgrp is used elsewhere in process.c, and also make sure that it does what it does today on systems (w32) which have neither TIOCGPGRP nor tcgetpgrp.