From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: EMACS_GET_TTY_PGRP vs. emacs_get_tty_pgrp Date: Wed, 20 Oct 2010 14:59:12 -0400 Message-ID: References: <4CBEFB15.5050303@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1287601164 9785 80.91.229.12 (20 Oct 2010 18:59:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2010 18:59:24 +0000 (UTC) Cc: emacs-devel To: Ken Brown Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 20 20:59: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 1P8dse-0007xg-8F for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2010 20:59:20 +0200 Original-Received: from localhost ([127.0.0.1]:34935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8dsd-0007eg-RY for ged-emacs-devel@m.gmane.org; Wed, 20 Oct 2010 14:59:19 -0400 Original-Received: from [140.186.70.92] (port=42407 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8dsY-0007dy-Aa for emacs-devel@gnu.org; Wed, 20 Oct 2010 14:59:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8dsX-0008Ah-8X for emacs-devel@gnu.org; Wed, 20 Oct 2010 14:59:14 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:50093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8dsX-0008Ad-5r for emacs-devel@gnu.org; Wed, 20 Oct 2010 14:59:13 -0400 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1P8dsW-0000qO-C5; Wed, 20 Oct 2010 14:59:12 -0400 In-Reply-To: <4CBEFB15.5050303@cornell.edu> (Ken Brown's message of "Wed\, 20 Oct 2010 10\:22\:13 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:131906 Archived-At: Ken Brown writes: > The macro EMACS_GET_TTY_PGRP defined in src/systty.h uses either > tcgetpgrp or TIOCGPGRP to get the PGID of a terminal's foreground It does not: #ifndef DOS_NT #define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd))) #define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid))) #endif /* not DOS_NT */ also, I have a patch to remove this, it's only used in two places, so it's not very useful as an abstraction. > process group. But src/process.c defines and uses its own > emacs_get_tty_pgrp that only works on systems that have TIOCGPGRP. Is > there a good reason for this? If not, I would like to try to prepare > a patch to change process.c to use the macro instead. This would > simplify the code and would also extend some of the functionality in > process.c to systems that have tcgetpgrp but not TIOCGPGRP. > > Ken