aboutsummaryrefslogtreecommitdiff
path: root/bin/ps
Commit message (Collapse)AuthorAgeFilesLines
* Make it so users can select the new (5.x) behavior for processing extraGarance A Drosehn2004-06-121-3/+7
| | | | | | | | parameters by compiling `ps' with -DPS_BACKWARD_COMPATIBILITY=0, instead of requiring them to patch ps.c. The default behavior has not changed. Notes: svn path=/stable/4/; revision=130381
* MFC *: Fix the kludge-old-options processing so `ps tpt' will be treatedGarance A Drosehn2004-06-081-107/+126
| | | | | | | | | | | | | | | | | | | | | the same as `ps -tpt', instead of being changed into `ps -tpT'. Also adjust it so `ps t p0' is treated like `ps -t p0', instead of making it `ps -T p0'. This includes the rewrite of the kludge-option processing, but it does NOT remove the long-undocumented BACKWARD_COMPATIBILITY compile-time option. If you delete the '#define BACKWARD_COMPATIBILITY' line, you'll get the newer handling for "extra arguments", which is to treat them as requests for processes. Also brings in a number of style(9) improvements. [* = 1.90 & 1.92 -> 1.98 ps.c] PR: bin/52489 (for `ps tpt' and `ps t p0') Submitted by: Jilles Tjoelker ( " ) Notes: svn path=/stable/4/; revision=130220
* MFC 1.74 1.75 & 1.80: Sort the declarations of global variables, andGarance A Drosehn2004-04-041-24/+28
| | | | | | | | | split two 'fmt' strings so they're easier to read on 80-char windows. Approved by: re(scottl) Notes: svn path=/stable/4/; revision=127847
* MFC 1.73 & 1.83: Sort the routine prototypes.Garance A Drosehn2004-04-041-10/+10
| | | | | | | Approved by: re(scottl) Notes: svn path=/stable/4/; revision=127846
* MFC *: Change the #if-ish logic which is used to add the `-f' optionGarance A Drosehn2004-04-041-15/+14
| | | | | | | | | | | | | | 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. Also move the 'f' case in the select statement, so it in alphabetical order. [* = 1.68 1.69 & 1.86 ps.c] Approved by: re(scottl) Notes: svn path=/stable/4/; revision=127845
* MFC *: Support more POSIX/SUSv3 options:Garance A Drosehn2004-04-043-212/+665
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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 should result in no user-visible changes, except for adding the new features. The man page is updated to describe the new features, and to describe the sorting options in better and more complete detail. [* = 1.67 1.72 1.76->1.79 1.84 & 1.85 ps.c, 1.71->1.74 ps.1] Approved by: re(scottl) Notes: svn path=/stable/4/; revision=127842
* MFC 1.66: Fix 'ps -p proclist' and 'ps -u userlist' so the commandGarance A Drosehn2004-03-271-3/+13
| | | | | | | | 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... Notes: svn path=/stable/4/; revision=127490
* MFC *: Improvements to 'ps -p <x>'. Wrt 4.x-stable, this adds supportGarance A Drosehn2004-03-272-21/+105
| | | | | | | | | | 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'. [* = 1.65 ps.c, 1.67 ps.1] Notes: svn path=/stable/4/; revision=127489
* More code-diff reductions wrt ps.c in 5.x-current, to make it easier toGarance A Drosehn2004-03-253-23/+66
| | | | | | | MFC some upcoming updates. This should cause no user-visible changes. Notes: svn path=/stable/4/; revision=127414
* MFC various style(9)-ish and other cosmetic changes from -current,Garance A Drosehn2004-03-237-206/+194
| | | | | | | | | | | mainly to greatly reduce the code-diffs in ps.c (but that dragged in some similar changes to the other files). This should result in no user-visible changes. This is done to make it easier to MFC some user-visible changes that are coming up, but those MFC's will be done at a later date. Notes: svn path=/stable/4/; revision=127334
* MFC rev 1.66: Bring ps(1) up to date with changesColin Percival2004-01-291-27/+12
| | | | | | | | | | | in the past seven years. PR: bin/34955 Submitted by: Tim Robbins Approved by: rwatson (mentor) Notes: svn path=/stable/4/; revision=125214
* MFC: 1.64Christian Brueffer2003-08-091-2/+2
| | | | | | | | Clarify that the 'state' information consists of characters, not only letters (e.g. IWs+) Notes: svn path=/stable/4/; revision=118692
* MFC rev 1.76: Do not print a header line if it would be empty.Tim J. Robbins2002-11-301-0/+9
| | | | Notes: svn path=/stable/4/; revision=107409
* MFC keyword.c rev1.56, print a list of valid formats when no valid formatsJuli Mallett2002-10-101-2/+5
| | | | | | | are given. Notes: svn path=/stable/4/; revision=104822
* MFC: don't try to decode old-style options if argv[1] begins with `-' and isMaxim Sobolev2002-07-041-10/+24
| | | | | | | an option taking an argument (rev.1.55). Notes: svn path=/stable/4/; revision=99402
* The .Nm utilityPhilippe Charnier2002-06-201-2/+6
| | | | Notes: svn path=/stable/4/; revision=98517
* MFC: Don't overflow command buffer.Mike Heffner2002-03-161-4/+8
| | | | | | | 1.15 +8 -4 src/bin/ps/fmt.c Notes: svn path=/stable/4/; revision=92385
* MFC: misc locale improvementsAlexey Zelkin2002-03-121-7/+14
| | | | | | | | | | rev 1.38, no need to work around SCCS variable expansion any more rev 1.42, use decimal point from locale rev 1.44, use AM/PM time only when available in locale rev 1.45, set use_ampm only when needed Notes: svn path=/stable/4/; revision=92158
* MFC: deorbit the -W option.Ruslan Ermilov2002-02-012-21/+7
| | | | Notes: svn path=/stable/4/; revision=90062
* MFC: Only capitalise the last `t' in ps's first argument when it'sBrian Somers2001-09-261-1/+5
| | | | | | | | | actually part of an option argument. PR: 13870 Notes: svn path=/stable/4/; revision=83960
* MFC: print.c 1.49, keyword.c 1.33: Banish KERNBASE masking that wasn'tPeter Wemm2001-09-212-4/+4
| | | | | | | much use (the kernel addresses are too large to mask). Notes: svn path=/stable/4/; revision=83754
* MFC: markup and misc fixes.Ruslan Ermilov2001-08-161-4/+3
| | | | | | | Approved by: re Notes: svn path=/stable/4/; revision=81764
* MFC: MAXPATHLEN -> PATH_MAXDavid E. O'Brien2001-08-011-2/+2
| | | | Notes: svn path=/stable/4/; revision=80815
* MFC: rcsidDavid E. O'Brien2001-08-011-0/+2
| | | | Notes: svn path=/stable/4/; revision=80814
* MFC 1.36: correct typo.Dima Dorfman2001-06-081-1/+1
| | | | Notes: svn path=/stable/4/; revision=77897
* MFC 1.35: document kern.ps_showallprocs.Dima Dorfman2001-06-081-1/+5
| | | | Notes: svn path=/stable/4/; revision=77891
* MFC: recent mdoc(7) fixes.Ruslan Ermilov2001-03-051-1/+1
| | | | Notes: svn path=/stable/4/; revision=73776
* MFC: rev 1.14 (fix rcsid)David E. O'Brien2001-03-021-0/+6
| | | | Notes: svn path=/stable/4/; revision=73333
* MFC: r1.29, coredump fix.Jonathan Lemon2001-02-141-1/+1
| | | | Notes: svn path=/stable/4/; revision=72490
* MFC: Support multiple (comma separated) names as arguments to -U.Jeroen Ruigrok van der Werven2001-01-231-13/+69
| | | | Notes: svn path=/stable/4/; revision=71432
* MFC: recent mdoc(7) fixes.Ruslan Ermilov2000-12-081-2/+2
| | | | Notes: svn path=/stable/4/; revision=69762
* MFC: spelling correctionJordan K. Hubbard2000-09-201-1/+1
| | | | Notes: svn path=/stable/4/; revision=66092
* MFC: Fix exit code if process does not exist.Will Andrews2000-07-081-1/+1
| | | | Notes: svn path=/stable/4/; revision=62804
* I'm probably jumping the gun, but what the heck, this is -current.Peter Wemm1999-11-171-2/+2
| | | | | | | | | | | | | | | | | | Turn off setgid-kmem for /bin/ps, it's now quite functional without it. ps no longer needs /dev/*mem or /proc. (It will still use some /proc files if they are available for -e, but it's not required, so it'll happily run in a jail or chroot). The proc stats are now part of eproc (obtained via sysctl) and no longer needs to beat up the u-page reading code and the problems with that. This also has the side effect of disabling 'ps -e' for normal users *EXCEPT* when looking at their own processes. ie: they can see environments in processes with their uid, enforced by the ownership of /proc/*/mem. Root can still see them all, as it can open all /proc/*/mem. Notes: svn path=/head/; revision=53278
* Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.Peter Wemm1999-11-171-60/+19
| | | | | | | Also, fix some indentation that got messed up somehow.. Notes: svn path=/head/; revision=53276
* Introduce commandline caching in the kernel.Poul-Henning Kamp1999-11-161-1/+1
| | | | | | | | | | | | | | This fixes some nasty procfs problems for SMP, makes ps(1) run much faster, and makes ps(1) even less dependent on /proc which will aid chroot and jails alike. To disable this facility and revert to previous behaviour: sysctl -w kern.ps_arg_cache_limit=0 For full details see the current@FreeBSD.org mail-archives. Notes: svn path=/head/; revision=53239
* Typo (appropiate -> appropriate)Kris Kennaway1999-11-151-1/+1
| | | | | | | Obtained from: OpenBSD (inspired by) Notes: svn path=/head/; revision=53170
* $Id$ -> $FreeBSD$Peter Wemm1999-08-278-8/+8
| | | | Notes: svn path=/head/; revision=50471
* Correct reference to the obsolete vadvise() to madvise() (with appropriateKris Kennaway1999-06-301-5/+5
| | | | | | | | | | | arguments) PR: 11586 Submitted by: David Gilbert <dgilbert@velocet.ca> Reviewed by: Doug Rabson Notes: svn path=/head/; revision=48366
* Various spelling/formatting changes.Kris Kennaway1999-05-081-3/+3
| | | | | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org> Notes: svn path=/head/; revision=46684
* This Implements the mumbled about "Jail" feature.Poul-Henning Kamp1999-04-282-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/ Notes: svn path=/head/; revision=46155
* Update p_flags doc.Peter Wemm1999-04-061-3/+1
| | | | Notes: svn path=/head/; revision=45367
* Look at p_lock instead of P_NOSWAP etc as an indicator of unswappability.Peter Wemm1999-04-061-2/+4
| | | | | | | | (While here, put a #ifndef pgtok around the macro that gets a redefinition warning) Notes: svn path=/head/; revision=45366
* On FreeBSD/alpha, ps(1) does not correctly report process start timesBill Paul1999-04-011-1/+40
| | | | | | | | | | | | | | | | | | | | and CPU runtime because it can't access the user area via /proc/<pid>/mem. This is because the uarea is not mapped into the process address space at USRSTACK on the alpha like it is on the x86. Since I'm haven't been able to wrap my brain around the VM system enough to be able to figure out how to achieve this mapping, and since it's questionable that such an architectural change is correct, I implemented a workaround to allow ps(1) to read the uarea from /dev/kmem using kvm_read() instead of from the process address space via kvm_uread(). The kludge is hidden inside #ifdef __alpha__/#endif so as not to impact the x86. (Note that top(1) probably uses this same gimmick since it works on FreeBSD/alpha.) Reviewed by: dfr Notes: svn path=/head/; revision=45227
* Enable Linux threads support by default.Julian Elischer1999-01-261-8/+1
| | | | | | | | | | | | This takes the conditionals out of the code that has been tested by various people for a while. ps and friends (libkvm) will need a recompile as some proc structure changes are made. Submitted by: "Richard Seaman, Jr." <dick@tar.com> Notes: svn path=/head/; revision=43208
* Re-enable the options in ps(1) that were disabled with the LinuxJulian Elischer1999-01-131-1/+6
| | | | | | | | | threads support. Submitted by: "Richard Seaman, Jr." <dick@tar.com> Notes: svn path=/head/; revision=42612
* Reviewed by: Luoqi Chen, Jordan HubbardJulian Elischer1998-12-191-1/+3
| | | | | | | | | | | | | | | Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours. Notes: svn path=/head/; revision=41931
* Fixed -Wall regression (broken in rev.1.12). Removed unused includes.Bruce Evans1998-12-071-3/+3
| | | | Notes: svn path=/head/; revision=41580
* Fix formatting of %CPU value on alpha.Doug Rabson1998-11-251-3/+3
| | | | | | | Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp> Notes: svn path=/head/; revision=41324
* Portability fixes when sizeof(int) != sizeof(long).Doug Rabson1998-09-143-41/+47
| | | | Notes: svn path=/head/; revision=39160