summaryrefslogtreecommitdiffstats
path: root/bin/ps
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of a cast to '(void) ' on the return of a call to strcpy.gad2004-06-221-1/+1
|
* Oops. Undo that last 'const' change. It expects similar changes to somegad2004-06-222-13/+11
| | | | other files that I am not ready to commit yet...
* Add 'const' to a few places.gad2004-06-222-11/+13
| | | | | PR: bin/65803 Submitted by: Cyrille Lefevre
* When displaying the "COMMAND" field for system-processes and/or kernelgad2004-06-222-1/+4
| | | | | | | | | | threads, put the command name in square brackets instead of parenthesis. This matches NetBSD, and also seems to be what linux does. The sentence which is added to the man page is taken straight from NetBSD. PR: bin/65803 Submitted by: Cyrille Lefevre Obtained from: NetBSD
* Have `ps' return the cputimes for zombies, with the assumption thatgad2004-06-211-1/+1
| | | | | | | kvm_getprocs() will provide useful information if it can, or *it* will provide a zero value if it can not find something appropriate. Submitted by: bde
* Add the `-O emul' format option, which prints the name of the system-callgad2004-06-203-0/+13
| | | | | | | | emulation environment the process is in. "emul" as a keyword is picked up from OpenBSD. PR: bin/65803 Submitted by: Cyrille Lefevre
* From SUSv3:gad2004-06-201-1/+1
| | | | | | | | | | | Any [standard output] field need not be meaningful in all implementations. In such a case a hyphen ('-') should be output in place of the field value So have the `-O label' option print out the string " -" if the process has no label. Approved by: Silence from rwatson and green (when asked in March...)
* Add new output-format keywords of LWP and NLWP, which show the thread-idgad2004-06-201-0/+8
| | | | | | | | | | and number-of-threads tied to a process. Result can be seen by typing, e.g.: ps -HO lwp,nlwp These new options are not documented yet. More options will be coming, and I will update the man page after I get farther along. PR: bin/65803 (though adjusted to fit our present source) Submitted by: Cyrille Lefevre
* Have the main() routine calculate %CPU and (if needed) memory informationgad2004-06-202-36/+31
| | | | | | | when copying per-process info before starting to sort the list. This way, sort-by-CPU or sort-by-memory will only calculate values once-per-process, instead of twice-per-comparison. Also take advantage of this to simplify the pscomp() routine.
* Try to change the isdigitch() macro to something that Bruce won't rollgad2004-06-011-3/+3
| | | | | his eyes at quite so much... (actually someone else pointed this out to me a long time ago, but apparently I never fixed it)
* A few more style-fixes from Bruce. The only non-cosmetic changegad2004-06-011-16/+9
| | | | | | is to drop a call to setuid() which has not been needed for years. Noticed by: bde
* Since I'm not ready to add the non-standard ADD_PS_LISTRESET feature,gad2004-06-011-26/+1
| | | | | remove the #ifdef for it for now. I might add the feature for real at some later date, there isn't much reason for the #ifdef for now.
* Make a few style-istic improvements to the previous commits.gad2004-06-011-16/+15
| | | | Noticed by: bde
* Fix so `ps' catches and complains about null-values specified for agad2004-06-011-3/+8
| | | | | | | process id, instead of using pid==0. Ie, `ps -p 12,' and `ps -p ,12' are now errors (instead of being treated like `ps -p 0 -p 12'). Noticed by: Cyrille Lefevre on freebsd-arch
* Additional tiny adjustment to kludge-option processing so `ps t p0'gad2004-06-011-6/+7
| | | | | | | | is treated like `ps -t p0', instead of changing it to `ps -T p0'. Note that `ps t' is still changed to `ps -T', since that is one of the main reasons for this kludge processing... Noticed by: Jilles Tjoelker on freebsd-arch
* Rewrite the kludge-option processing to improve how it handles a fewgad2004-06-011-62/+91
| | | | | | | | | | | | | | | | | | | | more special situations. This is the code which process `ps blah', when "blah" does not include a leading '-'. This change also removes a long-undocumented BACKWARD_COMPATIBILITY compile-time option, where: ps -options arg1 arg2 (with no '-' on "arg1" and "arg2") was treated as: ps -options -N arg1 -M arg2 This also changes `ps' to check for any additional arguments after processing all the '-'-options, and attempt to use those arguments as a pid or pidlist. If an extra argument is not a valid pidlist, then `ps' will print an error and exit. This seems a more generally useful extension of the kludge-option processing than the -N/-M behavior, and has fewer confusing side-effects. Reviewed by: freebsd-arch
* Add pgrep(1) and pkill(1) to the cross-reference section of ps(1).gad2004-05-251-0/+2
|
* Add the 'sid' info to the output of `ps -j', to make up for the 'sess'gad2004-05-232-2/+2
| | | | | | | (session-pointer) info which was dropped from `ps' earlier in 5.x. PR: bin/59423 Submitted by: Jilles Tjoelker
* Fix the kludge-old-options processing so `ps tpt' will be treated thegad2004-05-231-4/+5
| | | | | | | | same as `ps -tpt', instead of being changed into `ps -tpT'. PR: bin/52489 Submitted by: Jilles Tjoelker MFC after: 1 week
* Change `ps' to use the KERN_PROC_RGID and KERN_PROC_SESSION optionsgad2004-05-221-8/+5
| | | | | | | | (if trying to match only one real-group or one session-id), now that those options are implemented in src/sys/kern/kern_proc.c (v1.203). PR: bin/65803 (a very tiny piece of the PR) Submitted by: Cyrille Lefevre
* Assorted markup fixes.ru2004-05-161-209/+227
|
* Remove clause 3 from the UCB licenses.markm2004-04-068-32/+0
| | | | OK'ed by: imp, core
* Drop the include of <stdint.h>, since r1.84 removed references of intmax_t.gad2004-04-041-1/+0
|
* Add back the `-e' option, which was mistakenly dropped when cleaninggad2004-04-041-1/+1
| | | | | up the PS_ARGS string in revision 1.69 (and which was apparently not missed by anyone...).
* Give a name of 'l' (list) to the union in struct listinfo. This isgad2004-04-041-28/+30
| | | | | because some compilers (such as gcc 2.95.4) do not support having an unnamed union for a field in a struct.
* Add spaces after flag names on .Fl macros.gad2004-04-011-2/+2
| | | | | Noticed by: ru MFC after: 4 days
* Describe the sorting options in better and more complete detail.gad2004-03-311-6/+29
| | | | | | Also improve the description of `-L' a little. MFC after: 4 days
* Switch to using strtoul() for parsing a potential UID or GID, which getsgad2004-03-301-9/+8
| | | | | | | this to correctly handle UID's and GID's larger than 2147483647. Noticed by: bde MFC after: 1 week
* Bruce would really like the prototype for fmt() to be split across linesgad2004-03-301-1/+2
| | | | | | | this way (although I still think it "looks weird"...). Requested by: bde MFC after: 1 week
* Minor style fixes, mostly adding indent-protection on some comment-blocks.gad2004-03-301-6/+6
| | | | | Noticed by: bde MFC after: 1 week
* Replace pscomp() with a cleaner version, mostly written by bde (*).gad2004-03-301-14/+43
| | | | | | | | | | | 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
* Oops. Remove some ';'s in #defines added by a previous update.gad2004-03-291-2/+2
| | | | Noticed by: bde
* Have this source explicitly include <sys/proc.h>, since it referencesgad2004-03-291-0/+1
| | | | | | | 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
* Since "kp" is a pointer, I should be comparing against NULL not 0.gad2004-03-291-1/+1
| | | | Noticed by: bde
* Various style improvements, mostly in comments and indentation.gad2004-03-291-43/+58
| | | | Suggested by: bde (well, for most of them)
* In the routines I've been working on, sort the variable declartionsgad2004-03-291-9/+9
| | | | | | so that non-pointers are listed after pointer-type variables. Noticed by: bde
* Split two 'fmt' strings so they're easier to read on 80-char windows.gad2004-03-291-2/+4
|
* Sort the declarations of global variables.gad2004-03-291-24/+25
|
* Sort the routine prototypes.gad2004-03-281-10/+9
|
* If <x> is a process id that does not exist, then just print the headergad2004-03-281-1/+1
| | | | | | | (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).
* Fix `-o rtprio' so it prints the correct value.gad2004-03-281-2/+2
| | | | | | PR: bin/59417 Submitted by: Jan Willem Knopper This fix by: bde (in the audit-trail of the PR)
* If a non-existent user is given as part of `-U userlist', treat it asgad2004-03-271-11/+6
| | | | | 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.
* Explicitly wrap two long-ish linesi of code, to make them easier to read.gad2004-03-271-2/+4
|
* Change the #if-ish logic which is used to add the `-f' option when `ps'gad2004-03-271-9/+9
| | | | | | 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.
* Move the 'f' case so it shows up in the right place, alphabetically.gad2004-03-271-6/+6
|
* Update the date on the man page, since this the previous change addedgad2004-03-271-1/+1
| | | | a few new options.
* Support more POSIX/SUSv3 options:gad2004-03-272-187/+580
| | | | | | | | | | | | | | | | | | | | | | - 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.
* Avoid the manpage layering violation and low-level implementationru2004-03-261-3/+2
| | | | | details of libkvm, and just tell what the getbootfile(3) function will return, by using the text from netstat(1) and dmesg(8).
* - Remove references to /dev/kmem -- ps(1) utilizes theru2004-03-261-11/+5
| | | | | | | 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.
* Document incorrect handling of multibyte characters.tjr2004-03-211-1/+6
|
OpenPOWER on IntegriCloud