From owner-freebsd-standards@FreeBSD.ORG Thu Mar 25 13:08:01 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CE0F16A4CE for ; Thu, 25 Mar 2004 13:08:01 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 105B043D3F for ; Thu, 25 Mar 2004 13:08:01 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PL7xHB006672; Thu, 25 Mar 2004 16:08:00 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1080247208.2232.1095.camel@cube> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> Date: Thu, 25 Mar 2004 16:07:58 -0500 To: Albert Cahalan , Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 21:08:01 -0000 At 3:40 PM -0500 3/25/04, Albert Cahalan wrote: > >Also, I'd be happy to support a FreeBSD-compatible "Z" if you >can properly describe it to me. This description from the source might help (since I have not written the man-page entry for it yet. Ahem...): case 'X': /* * Note that `-X' and `-x' are not standard "selector" * options. For most selector-options, we check *all* * processes to see if any are matched by the given * value(s). After we have a set of all the matched * processes, then `-X' and `-x' govern whether we * modify that *matched* set for processes which do * not have a controlling terminal. `-X' causes * those processes to be deleted from the matched * set, while `-x' causes them to be kept. */ xkeep = 0; break; case 'x': xkeep = 1; break; Before option-parsing, the variable xkeep starts out as -1, and xkeep_implied starts out as 0. Options like `-t' and `-G' set xkeep_implied = 1, because I think that's what we have to do to match the spirit of SUSv3. After option-parsing is done, there is: if (xkeep < 0) /* Neither -X nor -x was specified */ xkeep = xkeep_implied; The `-p pidlist' option does NOT set xkeep_implied, but the pidlist is checked before the xkeep variable, so processes are always matched no matter what value xkeep ends up with. The `-A' option will also set xkeep (not xkeep_implied). -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu