NetBSD Problem Report #17497

Received: (qmail 4592 invoked by uid 605); 6 Jul 2002 22:39:23 -0000
Message-Id: <Pine.SOL.4.44.0207062334410.13080-100000@libra.cus.cam.ac.uk>
Date: Sat, 6 Jul 2002 23:39:21 +0100 (BST)
From: Ben Harris <bjh21@netbsd.org>
Sender: gnats-bugs-owner@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: POSIX.1-2001: ps -A not supported

>Number:         17497
>Category:       standards
>Synopsis:       POSIX.1-2001: ps -A not supported
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 06 22:40:00 +0000 2002
>Closed-Date:    Sun Apr 10 15:41:04 +0000 2011
>Last-Modified:  Sun Apr 10 15:41:04 +0000 2011
>Originator:     Ben Harris
>Release:        1.6_BETA4
>Organization:
>Environment:
NetBAD/acorn32 1.6_BETA4

>Description:
POSIX.1-2001 (and probably POSIX.2-1992) specifies the following option
for ps:

    -A  Write information for all processes.

NetBSD's ps doesn't support this.

>How-To-Repeat:
$ ps -A
ps: unknown option -- A
usage:  ps [-acCehjKlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty]
           [-M core] [-N system] [-W swap] [-U username]
        ps [-L]

>Fix:

>Release-Note:
>Audit-Trail:

From: Simon Burge <simonb@wasabisystems.com>
To: Ben Harris <bjh21@netbsd.org>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: standards/17497: POSIX.1-2001: ps -A not supported
Date: Sun, 7 Jul 2002 18:50:38 +1000

 On Sat, Jul 06, 2002 at 11:39:21PM +0100, Ben Harris wrote:

 > >Number:         17497
 > >Category:       standards
 >
 > POSIX.1-2001 (and probably POSIX.2-1992) specifies the following option
 > for ps:
 > 
 >     -A  Write information for all processes.

 Err, SUSv3 lists a few options that we don't implement, and some that
 cross over between SysV ps and BSD ps.  This is what SUSv3 says for ps:

    ps [-aA][-defl][-G grouplist][-o format]...[-p proclist][-t termlist]
       [-U userlist][-g grouplist][-n namelist][-u userlist]

 In general, a *BSD system isn't going to support all the SysV ps
 options.  Should we just say as much in the manpage?

 I have some patches that implement most SysV options but never have
 committed them because no one could ever agree on how to choose which
 style of option processsing to use...

 Simon.
 --
 Simon Burge                                   <simonb@wasabisystems.com>
 NetBSD Development, Support and Service:   http://www.wasabisystems.com/

From: Simon Burge <simonb@wasabisystems.com>
To: Ben Harris <bjh21@netbsd.org>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: standards/17497: POSIX.1-2001: ps -A not supported
Date: Sun, 7 Jul 2002 18:54:07 +1000

 On Sun, Jul 07, 2002 at 06:50:38PM +1000, Simon Burge wrote:

 > This is what SUSv3 says for ps:
 > 
 >    ps [-aA][-defl][-G grouplist][-o format]...[-p proclist][-t termlist]
 >       [-U userlist][-g grouplist][-n namelist][-u userlist]

 Oops, I forgot to ask what POSIX.1-2001 specifies for ps(1)s options.

 Simon.
 --
 Simon Burge                                   <simonb@wasabisystems.com>
 NetBSD Development, Support and Service:   http://www.wasabisystems.com/

From: Ben Harris <bjh21@netbsd.org>
To: Simon Burge <simonb@wasabisystems.com>
Cc: gnats-bugs@gnats.netbsd.org, <netbsd-bugs@netbsd.org>
Subject: Re: standards/17497: POSIX.1-2001: ps -A not supported
Date: Sun, 7 Jul 2002 11:02:02 +0100 (BST)

 On Sun, 7 Jul 2002, Simon Burge wrote:

 > On Sat, Jul 06, 2002 at 11:39:21PM +0100, Ben Harris wrote:
 >
 > > >Number:         17497
 > > >Category:       standards
 > >
 > > POSIX.1-2001 (and probably POSIX.2-1992) specifies the following option
 > > for ps:
 > >
 > >     -A  Write information for all processes.
 >
 > Err, SUSv3 lists a few options that we don't implement, and some that
 > cross over between SysV ps and BSD ps.

 That's why I said "POSIX".  The POSIX.1-2001 version of ps (i.e. IEEE
 1003.1-2001 without the XSI option) should't have any conflicts with our
 one.  Unfortunately, because of the way the shading is done in
 1003.1-2001, it's a bit hard to see, but the POSIX synopsis boils down to:

 ps [-aA] [-G grouplist] [-o format] [-p proclist] [-t termlist]
    [-U userlist]

 I would never suggest that we should implement the XSI version of ps.

 -- 
 Ben Harris                                                   <bjh21@netbsd.org>
 Portmaster, NetBSD/acorn26           <URL:http://www.netbsd.org/Ports/acorn26/>


From: Simon Burge <simonb@wasabisystems.com>
To: Ben Harris <bjh21@netbsd.org>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: standards/17497: POSIX.1-2001: ps -A not supported
Date: Sun, 7 Jul 2002 20:07:19 +1000

 On Sun, Jul 07, 2002 at 11:02:02AM +0100, Ben Harris wrote:

 > On Sun, 7 Jul 2002, Simon Burge wrote:
 > 
 > > Err, SUSv3 lists a few options that we don't implement, and some that
 > > cross over between SysV ps and BSD ps.
 > 
 > That's why I said "POSIX".  The POSIX.1-2001 version of ps (i.e. IEEE
 > 1003.1-2001 without the XSI option) should't have any conflicts with our
 > one.  Unfortunately, because of the way the shading is done in
 > 1003.1-2001, it's a bit hard to see, but the POSIX synopsis boils down to:
 > 
 > ps [-aA] [-G grouplist] [-o format] [-p proclist] [-t termlist]
 >    [-U userlist]

 Ok, so we don't do -A and -G, and we don't support lists for -{p,t,U}.
 That's not too bad...

 Simon.
 --
 Simon Burge                                   <simonb@wasabisystems.com>
 NetBSD Development, Support and Service:   http://www.wasabisystems.com/

From: Simon Burge <simonb@wasabisystems.com>
To: Ben Harris <bjh21@netbsd.org>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: standards/17497: POSIX.1-2001: ps -A not supported
Date: Sun, 7 Jul 2002 20:55:52 +1000

 On Sun, Jul 07, 2002 at 08:07:19PM +1000, Simon Burge wrote:

 > On Sun, Jul 07, 2002 at 11:02:02AM +0100, Ben Harris wrote:
 > 
 > > That's why I said "POSIX".  The POSIX.1-2001 version of ps (i.e. IEEE
 > > 1003.1-2001 without the XSI option) should't have any conflicts with our
 > > one.  Unfortunately, because of the way the shading is done in
 > > 1003.1-2001, it's a bit hard to see, but the POSIX synopsis boils down to:
 > > 
 > > ps [-aA] [-G grouplist] [-o format] [-p proclist] [-t termlist]
 > >    [-U userlist]
 > 
 > Ok, so we don't do -A and -G, and we don't support lists for -{p,t,U}.
 > That's not too bad...

 The following patch adds -A and -G (again, for a single value and not a
 list).  I'll commit that soonish.  We need to come up with some words
 for the "STANDARDS" section of the manual page.  There's some variations
 looking at other man pages.  For cat(1):

      The cat utility is expected to conform to the IEEE Std 1003.2-1992
      (``POSIX.2'') specification.

      The flags [-benstv] are extensions to the specification.

 For cp(1):

      The cp utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compati-
      ble.

 For test(1):

      The test utility implements a superset of the IEEE Std 1003.2
      (``POSIX.2'') specification.

 Also, according to SUSv3, -U is for "real user ID numbers or login
 names" whereas we use it for the effective user ID, so we'd have to
 document that difference.

 Something like:

     The ps utility mostly implements a superset of the IEEE Std
     1003.1-2001 (``POSIX.2'') specification.  The -U option to
     the ps utility uses the effective user ID instead of the real
     user ID, and the -G, -p, -t, and -U options handle only a
     single argument instead of a list.

 sound ok?

 Simon.
 --
 Simon Burge                                   <simonb@wasabisystems.com>
 NetBSD Development, Support and Service:   http://www.wasabisystems.com/


 Index: ps.1
 ===================================================================
 RCS file: /cvsroot/basesrc/bin/ps/ps.1,v
 retrieving revision 1.54
 diff -d -p -u -r1.54 ps.1
 --- ps.1	2002/06/19 08:11:56	1.54
 +++ ps.1	2002/07/07 10:46:59
 @@ -41,8 +41,10 @@
  .Nd process status
  .Sh SYNOPSIS
  .Nm ""
 -.Op Fl acCehjlmrSTuvwx
 +.Op Fl aAcCehjlmrSTuvwx
  .Bk -words
 +.Op Fl G Ar gid
 +.Ek
  .Op Fl M Ar core
  .Ek
  .Bk -words
 @@ -90,7 +92,10 @@ state, and associated command.
  The options are as follows:
  .Bl -tag -width indent
  .It Fl a
 -Display information about other users' processes as well as your own.
 +Display information about other users' processes that have controlling
 +terminals as well as your own.
 +.It Fl A
 +Display information about all processes.
  .It Fl c
  Do not display full command with arguments, but only the
  executable name.
 @@ -105,6 +110,10 @@ no effect).
  .It Fl e
  Display the environment as well.  The environment for other
  users' processes can only be displayed by the super-user.
 +.It Fl G
 +Displays processes whose real gid has been given to the
 +.Fl G
 +switch.
  .It Fl h
  Repeat the information header as often as necessary to guarantee one
  header per page of information.
 Index: ps.c
 ===================================================================
 RCS file: /cvsroot/basesrc/bin/ps/ps.c,v
 retrieving revision 1.47
 diff -d -p -u -r1.47 ps.c
 --- ps.c	2002/06/19 08:11:56	1.47
 +++ ps.c	2002/07/07 10:46:59
 @@ -112,7 +112,7 @@ __RCSID("$NetBSD: ps.c,v 1.47 2002/06/19
   * ARGOPTS must contain all option characters that take arguments
   * (except for 't'!) - it is used in kludge_oldps_options()
   */
 -#define	GETOPTSTR	"acCeghjKLlM:mN:O:o:p:rSTt:U:uvW:wx"
 +#define	GETOPTSTR	"aAcCegG:hjKLlM:mN:O:o:p:rSTt:U:uvW:wx"
  #define	ARGOPTS		"MNOopUW"

  struct kinfo_proc2 *kinfo;
 @@ -181,6 +181,11 @@ main(argc, argv)
  			what = KERN_PROC_ALL;
  			flag = 0;
  			break;
 +		case 'A':
 +			what = KERN_PROC_ALL;
 +			flag = 0;
 +			xflg = 1;
 +			break;
  		case 'c':
  			commandonly = 1;
  			break;
 @@ -192,6 +197,11 @@ main(argc, argv)
  			break;
  		case 'g':
  			break;			/* no-op */
 +		case 'G':
 +			what = KERN_PROC_RGID;
 +			flag = atol(optarg);
 +			xflg = 1;
 +			break;
  		case 'h':
  			prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
  			break;
State-Changed-From-To: open->analyzed 
State-Changed-By: bjh21 
State-Changed-When: Thu Apr 10 02:56:07 PDT 2003 
State-Changed-Why:  
There's a patch which looks entirely plausible. 
From: Christopher Berardi <cberardi@natoufa.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: standards/17497
Date: Sat, 20 Feb 2010 13:42:19 -0500

 This switch is currently implemented in ps(1).



 -- 
 Christopher Berardi
 http://www.natoufa.com/

 Be still, and know that I am God (Psalms 46:10)

State-Changed-From-To: analyzed->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Sun, 10 Apr 2011 15:41:04 +0000
State-Changed-Why:

Should be fixed.



>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.