Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Mar 2004 16:07:58 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Albert Cahalan <albert@users.sourceforge.net>, Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: PATCH for a more-POSIX `ps', and related adventures
Message-ID:  <p0602047dbc88f7743c8e@[128.113.24.47]>
In-Reply-To: <1080247208.2232.1095.camel@cube>
References:  <1080165171.2232.910.camel@cube>	 <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p0602047dbc88f7743c8e>