PATCH for a more-POSIX `ps', and related adventures
Jilles Tjoelker
jilles+fbsd-standards at stack.nl
Mon Mar 22 07:59:03 PST 2004
On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote:
> It started out that I just wanted to get rid of one message that
> `ps' writes to stderr in -current but not in -stable. "As long as
> I was there", I thought I'd add support for a comma-separated list
> of processes for `ps -p' (as described in SUSv3). Alexey Dokuchaev
> asked if this change got us much closer to POSIX/SUS. Now it did
> get us a *little* closer, but in re-reading SUSv3 I realized that
> I didn't get it (that one option) quite as close as I would like.
> So, "as long as I was there", I figured I should try to come a
> little closer.
> Now, after about 30 consecutive "as long as I was there" small
> projects, I have an update which:
> [snip good stuff]
> Adds the `-G gidlist' and '-g pgidlist' options of SYSv3.
> (note that this replaced a null `-g' option...)
Old BSD ps used to exclude process group leaders unless `-g' or `-x'
were given.
> Adds a `-R ruserlist' option, which is the same as what
> SYSv3 describes for `-u' (we already have a `-u').
> Amazingly, none of solaris, linux, or irix seem to
> have any kind of `-R' option.
SUSv3 says -u selects by effective uid and -U selects by real uid.
FreeBSD -U selects by effective uid and -u is something else totally.
This is only of the (few) obstacles to SUSv3 (not XSI) compatibility
(another being the default selection). XSI level compatibility would
require a lot of POLA violation.
> [snip]
> Fixes interactions between all these "selector options",
> & our `-x' option (which is not mentioned in SUSv3).
> For the selector options, I tried to meet the
> description of: "If any are specified, the default
> list shall be ignored and ps shall select the
> processes represented by the inclusive OR of all
> the selection-criteria options."
Hmm, this means the user must add `-x' if `-U', `-s', etc. are used and
he wants to see all matching processes. That's not good for writing
scripts that should work on both Solaris and FreeBSD, for example. Also,
`-U' used to imply `-x' on FreeBSD (it does not on NetBSD).
I propose making it so that `-x' is implied when any selector except
`-a' is used.
> [snip]
Jilles Tjoelker
More information about the freebsd-standards
mailing list