Date: Thu, 1 May 2025 19:51:44 GMT From: Olivier Certner <olce@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 154ccb0196cd - stable/14 - ps(1): Update some options' conformance/practice comments Message-ID: <202505011951.541JpiQV068751@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=154ccb0196cd56954b976890acf85cdb2b0fd94c commit 154ccb0196cd56954b976890acf85cdb2b0fd94c Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2025-04-01 11:45:08 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2025-05-01 19:42:18 +0000 ps(1): Update some options' conformance/practice comments MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49621 (cherry picked from commit 2d7f70975bd8146f36b35477a8a1be490a0afc95) --- bin/ps/ps.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 10ae3924a923..786537a0e959 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -313,17 +313,24 @@ main(int argc, char *argv[]) break; case 'g': #if 0 - /*- - * XXX - This SUSv3 behavior is still under debate - * since it conflicts with the (undocumented) - * `-g' option. So we skip it for now. + /* + * XXX - This behavior is still under debate since it + * conflicts with the (undocumented) `-g' option + * and is non-standard. However, it is the + * behavior of most UNIX systems except + * SunOS/Solaris/illumos (see next comment; see + * also comment for '-s' below). */ add_list(&pgrplist, optarg); xkeep_implied = 1; nselectors++; break; #else - /* The historical BSD-ish (from SunOS) behavior. */ + /* + * The historical BSD-ish (from SunOS) behavior: Also + * display process group leaders (but we do not filter + * them out). + */ break; /* no-op */ #endif case 'H': @@ -376,7 +383,7 @@ main(int argc, char *argv[]) break; #if 0 case 'R': - /*- + /* * XXX - This un-standard option is still under * debate. This is what SUSv3 defines as * the `-U' option, and while it would be @@ -396,11 +403,13 @@ main(int argc, char *argv[]) break; #if 0 case 's': - /*- - * XXX - This non-standard option is still under - * debate. This *is* supported on Solaris, - * Linux, and IRIX, but conflicts with `-s' - * on NetBSD and maybe some older BSD's. + /* + * XXX - This non-standard option is still under debate. + * It is supported on Solaris, Linux, IRIX, and + * OpenBSD but conflicts with '-s' on NetBSD. This + * is the same functionality as POSIX option '-g', + * but the cited systems do not provide it under + * '-g', only under '-s'. */ add_list(&sesslist, optarg); xkeep_implied = 1; @@ -417,7 +426,12 @@ main(int argc, char *argv[]) nselectors++; break; case 'U': - /* This is what SUSv3 defines as the `-u' option. */ + /* + * POSIX says that '-U' should match on real user IDs, + * not effective ones as we are doing here, which is + * normally the behavior of option '-u' according to the + * standard. + */ add_list(&uidlist, optarg); xkeep_implied = 1; nselectors++; @@ -917,7 +931,7 @@ addelem_pid(struct listinfo *inf, const char *elem) return (1); } -/*- +/* * The user can specify a device via one of three formats: * 1) fully qualified, e.g.: /dev/ttyp0 /dev/console /dev/pts/0 * 2) missing "/dev", e.g.: ttyp0 console pts/0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505011951.541JpiQV068751>