summaryrefslogtreecommitdiffstats
path: root/bin/ps
Commit message (Collapse)AuthorAgeFilesLines
* I'm probably jumping the gun, but what the heck, this is -current.peter1999-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.
* Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.peter1999-11-171-60/+19
| | | | Also, fix some indentation that got messed up somehow..
* Introduce commandline caching in the kernel.phk1999-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.
* Typo (appropiate -> appropriate)kris1999-11-151-1/+1
| | | | Obtained from: OpenBSD (inspired by)
* $Id$ -> $FreeBSD$peter1999-08-278-8/+8
|
* Correct reference to the obsolete vadvise() to madvise() (with appropriatekris1999-06-301-5/+5
| | | | | | | | arguments) PR: 11586 Submitted by: David Gilbert <dgilbert@velocet.ca> Reviewed by: Doug Rabson
* Various spelling/formatting changes.kris1999-05-081-3/+3
| | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
* This Implements the mumbled about "Jail" feature.phk1999-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/
* Update p_flags doc.peter1999-04-061-3/+1
|
* Look at p_lock instead of P_NOSWAP etc as an indicator of unswappability.peter1999-04-061-2/+4
| | | | | (While here, put a #ifndef pgtok around the macro that gets a redefinition warning)
* On FreeBSD/alpha, ps(1) does not correctly report process start timeswpaul1999-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
* Enable Linux threads support by default.julian1999-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>
* Re-enable the options in ps(1) that were disabled with the Linuxjulian1999-01-131-1/+6
| | | | | | threads support. Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Reviewed by: Luoqi Chen, Jordan Hubbardjulian1998-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.
* Fixed -Wall regression (broken in rev.1.12). Removed unused includes.bde1998-12-071-3/+3
|
* Fix formatting of %CPU value on alpha.dfr1998-11-251-3/+3
| | | | Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
* Portability fixes when sizeof(int) != sizeof(long).dfr1998-09-143-41/+47
|
* Fixed breakage of %CPU and %MEM in the previous commit. sysctlbyname()bde1998-09-101-5/+11
| | | | | | was called with wrong args so it always failed. PR: 7881
* Pick up kernel variables/constants using sysctl rather than through /dev/memphk1998-06-302-80/+17
| | | | | | | | Use /dev/null for opening the kvm library, we don't need access to /dev/mem anymore. ps can now run without the setgid(kmem) bit. If it does it will not be able to show argv/envp for another uid's processes unless you are root.
* Fixed printf format errors (second round with non-i386 typedefs).bde1998-06-281-2/+3
|
* Oops, the previous log message should have read "Fixed type mismatches -bde1998-06-281-1/+1
| | | | don't assume that time_t is long".
* Fixed printf format errors.bde1998-06-281-4/+7
|
* Remove compile time dependency on ARG_MAX.jkoshy1998-06-171-2/+11
| | | | | PR: 1791 (partial) Reviewed by: Bruce Evans <bde@freebsd.org>, Tor Egge <tegge@freebsd.org>
* Fix errors that crept into the previous commit.jkoshy1998-06-041-3/+3
|
* 1. `ps' output now shows 3 characters in the `TT' field, not 2, afterjkoshy1998-06-041-3/+4
| | | | | | | | rev 1.6 of "ps.c". 2. Reword description of `-f' option. PR: 5340 Submitted by: Jorge Goncalves <j@bug.fe.up.pt>
* Fixed imperfections in previous commit (a poor variable name,bde1998-05-311-14/+14
| | | | excessive 64-bit arithmetic, and excessive changes).
* Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.phk1998-05-281-14/+14
| | | | | | | | | | | | | | | | | | | | Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
* If no value is present for the login name set it to '-'.steve1998-05-253-5/+39
| | | | | | | Also pretty-up the display of 'ps -Ortprio'. PR: 4947 Submitted by: Martin Kammerhofer <dada@sbox.tu-graz.ac.at>
* Correct use of .Nm. Add rcsid.charnier1998-05-155-23/+31
|
* Add 'f' flag to the optstring.dima1998-02-181-2/+2
|
* cosmetic change for optstringdima1998-02-181-2/+2
|
* Display VSZ much more accurately now.dyson1998-02-021-3/+2
|
* Document the new -f flag.dyson1997-12-051-1/+3
| | | | | PR: 5196 Submitted by: Matt Dillon <dillon@best.net>
* Add an option to building PS, so that the upages are explicitly paged in onlydyson1997-12-052-13/+44
| | | | | | | | | | | | | for users who are root, or in group wheel. This is useful on large timesharing systems where a PS command can cause the system to grind to a halt. The ability to get the information isn't diminished for those who really need the additional detail (administrators.) Normal users won't see any difference unless the processes are swapped out. The "really get it mode" is invoked by the use of an additional flag in the command string "-f". New/old behavior is selectable with a compile option. PR: 5196 Submitted by: Matt Dillon <dillon@best.net>
* Document correct option in manual page.jlemon1997-08-191-2/+2
| | | | | PR: 3769 Submitted by: johnp@lodgenet.com
* Use -I${.CURDIR}/../../sys so that the path is relativesteve1997-08-131-2/+2
| | | | | | to the source code directory. Submitted by: bde
* Oops, add #include's (forgotten in last commit) to make thissteve1997-08-111-1/+4
| | | | compile again.
* Use -I../../sys instead of -I/sys.steve1997-08-111-2/+2
|
* Remove #ifdef NEWVM code and remove extra "key.name = p" line.steve1997-08-111-125/+6
|
* Fix seg fault when invalid keywords are used.steve1997-08-111-3/+2
| | | | | PR: bin/4253 Submitted by: Jesse Rosenstock <jmr@ugcs.caltech.edu>
* Fix "lstart". (Displays "19" rather than time)peter1997-08-031-2/+2
| | | | | PR: 4206 Submitted by: Tetsuya Furukawa <tetsuya@secom-sis.co.jp>
* Kill #ifndef NEWVM etc. It affected a lot of other things besidespeter1997-08-034-130/+7
| | | | | | | VM structure (eg: credentials etc) and it's highly unlikely we'll ever get to see the "tainted" BSD<=4.3 VM code in public use. Although it indicated the way some things used to be done, it obfuscates things too much.
* devname.c moved to libc before Lite1 and isn't in ps in Lite2.bde1997-07-131-82/+0
|
* Cosmetic change in usage string.charnier1997-06-061-6/+5
|
* Dynamically adjust size of displayed username to the longest username whichjkh1997-04-295-145/+254
| | | | | | | appears, not the longest _maximum_ username (this should probably also go into 2.2, for the day when we bump up the username length there too). Submitted-By: Terry Lambert <terry@lambert.org>
* When "-c" is specified, don't pad the command with spaces if it isjdp1997-04-161-2/+5
| | | | | the last field on the line. "ps -axlc" was needlessly wrapping around on 80-character windows.
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-281-2/+2
| | | | posix standard on the topic.
* Fix buffer overflow (probably unexploitable).guido1997-03-101-2/+2
|
* Big usernames fixesache1997-03-041-4/+5
|
* Use MAXLOGNAME-1 for width because MAXLOGNAME includes NULache1997-03-031-3/+3
|
OpenPOWER on IntegriCloud