Commit graph

263 commits

Author SHA1 Message Date
Mark Murray 6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Garance A Drosehn b193355dc4 Drop the include of <stdint.h>, since r1.84 removed references of intmax_t. 2004-04-04 17:43:48 +00:00
Garance A Drosehn 9bf69950e1 Add back the `-e' option, which was mistakenly dropped when cleaning
up the PS_ARGS string in revision 1.69 (and which was apparently not
missed by anyone...).
2004-04-04 17:15:44 +00:00
Garance A Drosehn d822163f3b Give a name of 'l' (list) to the union in struct listinfo. This is
because some compilers (such as gcc 2.95.4) do not support having an
unnamed union for a field in a struct.
2004-04-04 04:41:51 +00:00
Garance A Drosehn 396e20d19f Add spaces after flag names on .Fl macros.
Noticed by:	ru
MFC after:	4 days
2004-04-01 13:28:36 +00:00
Garance A Drosehn 8ed0d42fe4 Describe the sorting options in better and more complete detail.
Also improve the description of `-L' a little.

MFC after:	4 days
2004-03-31 23:51:12 +00:00
Garance A Drosehn 0b42be7cb7 Switch to using strtoul() for parsing a potential UID or GID, which gets
this to correctly handle UID's and GID's larger than 2147483647.

Noticed by:	bde
MFC after:	1 week
2004-03-30 04:20:33 +00:00
Garance A Drosehn f35e071573 Bruce would really like the prototype for fmt() to be split across lines
this way (although I still think it "looks weird"...).

Requested by:	bde
MFC after:	1 week
2004-03-30 02:02:40 +00:00
Garance A Drosehn ba50b0e03a Minor style fixes, mostly adding indent-protection on some comment-blocks.
Noticed by:	bde
MFC after:	1 week
2004-03-30 01:59:22 +00:00
Garance A Drosehn 5bd7b1f3c0 Replace pscomp() with a cleaner version, mostly written by bde (*).
This corrects a problem of lost-precision for `-r' (sort-by-CPU).  Also,
for sort-by-CPU and sort-by-memory, any processes which have the same
value CPU or MEMORY are now sorted by TTY and then (if needed) by pid.

(* - I just added the NODEV checks, after doing some testing of my own)

Submitted by:	bde
MFC after:	1 week
2004-03-30 01:45:23 +00:00
Garance A Drosehn c46bb4b3ff Oops. Remove some ';'s in #defines added by a previous update.
Noticed by:	bde
2004-03-29 03:03:28 +00:00
Garance A Drosehn c7910c3ae3 Have this source explicitly include <sys/proc.h>, since it references
values such as P_CONTROLT and PS_INMEM.  But this still won't define
PID_MAX for us, since that is hidden inside of '#ifdef _KERNEL'.

Noticed by:	bde
2004-03-29 01:27:13 +00:00
Garance A Drosehn 87e47750f2 Since "kp" is a pointer, I should be comparing against NULL not 0.
Noticed by:	bde
2004-03-29 01:18:13 +00:00
Garance A Drosehn 352b652398 Various style improvements, mostly in comments and indentation.
Suggested by:	bde (well, for most of them)
2004-03-29 01:15:27 +00:00
Garance A Drosehn ca62e195dd In the routines I've been working on, sort the variable declartions
so that non-pointers are listed after pointer-type variables.

Noticed by:	bde
2004-03-29 00:25:09 +00:00
Garance A Drosehn 1d2324f442 Split two 'fmt' strings so they're easier to read on 80-char windows. 2004-03-29 00:16:19 +00:00
Garance A Drosehn de800cd4f8 Sort the declarations of global variables. 2004-03-29 00:12:03 +00:00
Garance A Drosehn 4857f240e1 Sort the routine prototypes. 2004-03-28 23:44:29 +00:00
Garance A Drosehn 5dfd7724a3 If <x> is a process id that does not exist, then just print the header
(if any) and exit, thus matching the behavior on -stable and other OS's.
My earlier attempt to fix this (v1.65) only seemed to work because of a
lucky random value in nentries (which was not being initialized back
when I tested that earlier patch).
2004-03-28 03:00:56 +00:00
Garance A Drosehn 3998d22271 Fix `-o rtprio' so it prints the correct value.
PR:		bin/59417
Submitted by:	Jan Willem Knopper
This fix by:	bde (in the audit-trail of the PR)
2004-03-28 02:13:31 +00:00
Garance A Drosehn e3c4e1dd77 If a non-existent user is given as part of `-U userlist', treat it as
a fatal error instead of a minor warning.  It is possible that a few
users are used to the previous behavior, but I'm claiming it was a bug.
2004-03-27 22:14:42 +00:00
Garance A Drosehn 29d58b106b Explicitly wrap two long-ish linesi of code, to make them easier to read. 2004-03-27 21:59:54 +00:00
Garance A Drosehn b34f38ae9e Change the #if-ish logic which is used to add the -f' option when ps'
is compiled with LAZY_PS, so that there is only one PS_ARGS string to
modify when changing the option-list.  Also get `-f' to show up in the
usage() statement when compiled with LAZY_PS.
2004-03-27 21:56:49 +00:00
Garance A Drosehn 4a355d176d Move the 'f' case so it shows up in the right place, alphabetically. 2004-03-27 21:40:04 +00:00
Garance A Drosehn 3dc91da529 Update the date on the man page, since this the previous change added
a few new options.
2004-03-27 18:26:40 +00:00
Garance A Drosehn a4c8a745a8 Support more POSIX/SUSv3 options:
- Change `-p' to allow a list of process IDs, and `-t' to allow a list
  of terminal names, instead of only a single value for each.
- Add the `-A' option of SUSv3, which is exactly the same as `-ax'.
- Add the `-G gidlist' (group id).
- Allow any of these "selector options" to be specified multiple times,
  and have `ps' keep adding to a given list -- instead of replacing the
  previously-specified values.
- Fix interactions between selector-options, so that: "If any are
  specified, ... ps shall select the processes represented by the
  inclusive OR of all the selection-criteria options." (from SUSv3)
- Add a `-X' option, which is the reverse of the `-x' option.

- various minor improvements in parsing and error handling.

This does not get us to match POSIX/SUSv3, but it gets us closer.  The
`-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in
freebsd-standards are still under debate, so they skipped for now.
It should be true that this introduces no user-visible incompatible
changes, except to support "new stuff" that was not supported before.
2004-03-27 18:22:17 +00:00
Ruslan Ermilov f9a480abb1 Avoid the manpage layering violation and low-level implementation
details of libkvm, and just tell what the getbootfile(3) function
will return, by using the text from netstat(1) and dmesg(8).
2004-03-26 08:54:27 +00:00
Ruslan Ermilov cd31922f27 - Remove references to /dev/kmem -- ps(1) utilizes the
sysctl(3) interface in kvm(3).
- Document the correct default when no -N is specified.
- Remove stale reference to /var/db/kvm_kernel.db.
- Remove stale reference to /var/run/dev.db.
2004-03-26 08:29:38 +00:00
Tim J. Robbins b59ca66070 Document incorrect handling of multibyte characters. 2004-03-21 11:24:06 +00:00
Garance A Drosehn 2e6c6ac4d7 Fix 'ps -p proclist' and 'ps -u userlist' so the command returns non-zero
if no processes were matched.  Also sorts the list of 'int's in main, as
long as I had to add another one...

Noticed by:	Nate Lawson
MFC after:	10 days
2004-03-18 01:28:23 +00:00
Garance A Drosehn 4e8b6a6fb0 Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, then
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.

Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.

Reviewed by:	mentioned on freebsd-current
MFC after:	10 days
2004-03-17 22:46:58 +00:00
Johan Karlsson c8edef9f48 style.Makefile:
Use WARNS?= instead of WARNS=
2004-02-23 20:05:14 +00:00
Daniel Eischen d75c1d8381 Allow the -H option to show threads when selecting by uid, tty,
and pid.
2004-02-22 17:59:31 +00:00
Juli Mallett 7cb9663b27 MFp4 @46705:
Support "uprocp" exactly like "paddr" with the former having been
documented in the manual but not implemented.

PR:		42484
2004-02-08 23:57:19 +00:00
Colin Percival bcf85d6737 Bring ps.1 up to date with changes in the past seven years:
* Remove mention of '>', 'A', and 'S' states
* Mention 'W' state.
* List 'J' state in the correct location.
* Sync with flags in sys/proc.h

Approved by: rwatson (mentor)
MFC after: 7 days
2004-01-21 16:25:36 +00:00
Ruslan Ermilov fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Hartmut Brandt de244df7c9 Implement the nwchan keyword that has been in the man page, but was
not implemented. This is just handy if you want to ddb the address
some process is waiting on.
2003-08-13 07:35:07 +00:00
Christian Brueffer a54b88d830 Clarify that the 'state' information consists of characters, not
only letters (e.g. IWs+)

PR:		55221
Submitted by:	Rich Morin <rdm@cfcl.com>
MFC after:	3 days
2003-08-05 10:31:28 +00:00
Mark Murray eac4bdcca4 Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by:	obrien
Tested on:	sparc64, alpha, i386
2003-06-13 07:04:02 +00:00
Scott Long 48b8c0de5a Add the -H option to ps(1) to display all kernel visible threads in each
process.  The default behavior of showing only the process is retained as
the default.
2003-06-12 16:53:55 +00:00
Philippe Charnier c6e6912512 add section name to .Xr 2003-06-08 09:48:39 +00:00
Mark Murray 6f0a94a9f1 Fix long constant usage for i386.
Tested by:	Joe Marcus Clarke <marcus@marcuscom.com>
2003-05-03 20:52:48 +00:00
Mark Murray 40feca3a99 Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on:	i386, alpha
2003-05-03 16:39:34 +00:00
David E. O'Brien 3e7045591d fmt.c has a comparison between signed and unsigned that is unclear how
to properly fix.
2003-05-02 01:05:05 +00:00
Jens Schweikhardt fbc8f8a2dc Fix references to non-existing or obsoleted man pages.
PR:	docs/51480 (only a small part)
Submitted by:	Diomidis D. Spinellis <dds@aueb.gr>
2003-04-30 19:18:50 +00:00
Philippe Charnier 2d5506c942 Revert the zombie part of previous commit 2003-04-15 18:49:20 +00:00
Philippe Charnier b85add5f31 Correct style bugs. Don't skip zombies in cputime(), according to Bruce,
zombie CPU times are valid. Adjust array size in strftime(3).

Submitted by:	Bruce
2003-04-14 19:51:36 +00:00
Tim J. Robbins e2c9ac698c Display residency and sleep times (re and sl fields) larger than 127 as 127.
This is what the manual page says ps should do, and what OpenBSD and NetBSD do.
Based on a patch from Ken Stailey.

PR:		27433, 46232
2003-04-12 10:39:56 +00:00
Maxim Sobolev 6f15bc16ed Fix slight disorder that broke sorting. Put in bold warning about the
fact that in this case order matters.

Submitted by:	Peter Edwards <pmedwards@eircom.net>
2003-02-05 19:22:39 +00:00
Philippe Charnier eaed5652bf Display elapsed time (-o etime) using [[dd-]hh:]mm:ss, which according to
Solaris man page is the POSIX way.

Reviewed by:	jmallett
2003-02-05 13:18:17 +00:00