diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 174f18a2f2d..ff9a847ffd8 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -371,8 +371,8 @@ Implies .Fl x by default. .It Fl U -Display information about processes whose effective user ID matches the -specified user IDs or names. +Display information about processes whose real user ID matches the specified +user IDs or names. Implies .Fl x by default. @@ -953,20 +953,16 @@ equivalently to .Pc , and option .Fl u -to select processes by effective user ID -.Po -which is the current behavior of option -.Fl U -.Pc . +to select processes by effective user ID. .Pp However, options -.Fl A , a , G , l , o , p , +.Fl A , a , G , l , o , p , U , and .Fl t behave as prescribed by .St -p1003.1-2024 . Options -.Fl f , U , +.Fl f and .Fl w currently do not, but may be changed to in the future. diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 6c007e8fc1a..a75ea512ad5 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -356,20 +356,6 @@ main(int argc, char *argv[]) */ nselectors++; 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 - * nice to have, it could cause even more - * confusion to implement it as `-R'. - */ - add_list(&ruidlist, optarg); - xkeep_implied = 1; - nselectors++; - break; -#endif case 'r': sortby = SORTCPU; break; @@ -401,21 +387,34 @@ main(int argc, char *argv[]) nselectors++; break; case 'U': + add_list(&ruidlist, optarg); + xkeep_implied = 1; + nselectors++; + break; + case 'u': +#if 0 /* - * 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. + * POSIX's '-u' behavior. + * + * This has not been activated because: + * 1. Option '-U' is a substitute for most users, and + * those that care seem more likely to want to match + * on the real user ID to display all processes + * launched by some users. + * 2. '-u' has been a canned display on the BSDs for + * a very long time (POLA). */ add_list(&uidlist, optarg); xkeep_implied = 1; nselectors++; break; - case 'u': +#else + /* Historical BSD's '-u'. */ parsefmt(ufmt, &varlist, 0); sortby = SORTCPU; _fmt = 1; break; +#endif case 'v': parsefmt(vfmt, &varlist, 0); sortby = SORTMEM;