Commit Graph

77 Commits

Author SHA1 Message Date
Doug Rabson 3929d51888 Portability fixes when sizeof(int) != sizeof(long). 1998-09-14 08:32:20 +00:00
Bruce Evans e36039e731 Fixed breakage of %CPU and %MEM in the previous commit. sysctlbyname()
was called with wrong args so it always failed.

PR:		7881
1998-09-10 18:06:28 +00:00
Poul-Henning Kamp 85082fc3c3 Pick up kernel variables/constants using sysctl rather than through /dev/mem
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.
1998-06-30 21:34:14 +00:00
Bruce Evans ce0cab88c1 Fixed printf format errors (second round with non-i386 typedefs). 1998-06-28 21:05:48 +00:00
Bruce Evans 86e14119e9 Oops, the previous log message should have read "Fixed type mismatches -
don't assume that time_t is long".
1998-06-28 18:26:18 +00:00
Bruce Evans f8ec5fe282 Fixed printf format errors. 1998-06-28 18:19:13 +00:00
Joseph Koshy c7bca09356 Remove compile time dependency on ARG_MAX.
PR: 1791 (partial)
Reviewed by: Bruce Evans <bde@freebsd.org>, Tor Egge <tegge@freebsd.org>
1998-06-17 11:33:10 +00:00
Joseph Koshy 55cb6cf5fb Fix errors that crept into the previous commit. 1998-06-04 07:02:59 +00:00
Joseph Koshy 77027e301b 1. `ps' output now shows 3 characters in the `TT' field, not 2, after
rev 1.6 of "ps.c".
2. Reword description of `-f' option.

PR: 5340
Submitted by: Jorge Goncalves <j@bug.fe.up.pt>
1998-06-04 06:46:13 +00:00
Bruce Evans 5832a75246 Fixed imperfections in previous commit (a poor variable name,
excessive 64-bit arithmetic, and excessive changes).
1998-05-31 12:09:50 +00:00
Poul-Henning Kamp e796e00de3 Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.
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
1998-05-28 09:30:28 +00:00
Steve Price ad863cac06 If no value is present for the login name set it to '-'.
Also pretty-up the display of 'ps -Ortprio'.

PR:		4947
Submitted by:	Martin Kammerhofer <dada@sbox.tu-graz.ac.at>
1998-05-25 05:07:18 +00:00
Philippe Charnier c9a8d1f4dd Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
Dima Ruban 0e3b741814 Add 'f' flag to the optstring. 1998-02-18 22:49:58 +00:00
Dima Ruban 6425bb4314 cosmetic change for optstring 1998-02-18 22:45:22 +00:00
John Dyson dc8ab2b64b Display VSZ much more accurately now. 1998-02-02 05:16:42 +00:00
John Dyson b548141b9b Document the new -f flag.
PR:	5196
Submitted by:	Matt Dillon <dillon@best.net>
1997-12-05 07:35:31 +00:00
John Dyson 3ac5e95583 Add an option to building PS, so that the upages are explicitly paged in only
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>
1997-12-05 07:33:40 +00:00
Jonathan Lemon 7d4774d0ab Document correct option in manual page.
PR:		3769
Submitted by:	johnp@lodgenet.com
1997-08-19 21:52:07 +00:00
Steve Price 6ad175c69e Use -I${.CURDIR}/../../sys so that the path is relative
to the source code directory.

Submitted by:	bde
1997-08-13 17:35:00 +00:00
Steve Price c1cee2f62b Oops, add #include's (forgotten in last commit) to make this
compile again.
1997-08-11 02:41:02 +00:00
Steve Price be73b9df4d Use -I../../sys instead of -I/sys. 1997-08-11 02:36:09 +00:00
Steve Price aeb7f2b6d3 Remove #ifdef NEWVM code and remove extra "key.name = p" line. 1997-08-11 02:35:16 +00:00
Steve Price e27525d9f8 Fix seg fault when invalid keywords are used.
PR:		bin/4253
Submitted by:	Jesse Rosenstock <jmr@ugcs.caltech.edu>
1997-08-11 02:29:50 +00:00
Peter Wemm e410bf2331 Fix "lstart". (Displays "19" rather than time)
PR: 4206
Submitted by: Tetsuya Furukawa <tetsuya@secom-sis.co.jp>
1997-08-03 08:33:17 +00:00
Peter Wemm 940cca66e2 Kill #ifndef NEWVM etc. It affected a lot of other things besides
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.
1997-08-03 08:25:01 +00:00
Bruce Evans 76b9a919c0 devname.c moved to libc before Lite1 and isn't in ps in Lite2. 1997-07-13 07:43:41 +00:00
Philippe Charnier 749d4bb649 Cosmetic change in usage string. 1997-06-06 06:40:06 +00:00
Jordan K. Hubbard 6a2d726b82 Dynamically adjust size of displayed username to the longest username which
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>
1997-04-29 05:26:05 +00:00
John Polstra 3cc273e0be When "-c" is specified, don't pad the command with spaces if it is
the last field on the line.  "ps -axlc" was needlessly wrapping
around on 80-character windows.
1997-04-16 16:08:11 +00:00
Warner Losh 93ef08af3e compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
Guido van Rooij 02289df91c Fix buffer overflow (probably unexploitable). 1997-03-10 19:10:08 +00:00
Andrey A. Chernov 32f6553e46 Big usernames fixes 1997-03-04 00:33:56 +00:00
Andrey A. Chernov 33c4e65a47 Use MAXLOGNAME-1 for width because MAXLOGNAME includes NUL 1997-03-03 08:20:28 +00:00
Peter Wemm b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Steve Price 78b09ffeaf -Wall cleaning. 1996-12-14 06:08:03 +00:00
Jeffrey Hsu 03fd7487d6 Remove unneeded #include <sys/proc.h>. 1996-11-10 06:13:12 +00:00
Peter Wemm db91faacb6 Implement a -c option to ps to display the short command name instead of
the full argument vector.

I've bumped into a few things that expected this switch to be present,
the most recent was the snmp package in ports.  I'm not 100% sure of the
origins of this, but Linux has it, so does the "BSD-compatable" version
of ps on our SVR4 systems (so I assume SunOS has it too).
1996-10-21 07:30:26 +00:00
David Greenman dc01a4f714 Updated to match kernel changes for timer/run queue. 1996-07-31 09:27:23 +00:00
Mike Pritchard 3b818f3a1f The default swap device is /dev/drum, not /dev/swap
as ps.1 states.

Submitted by:	Zahemszhky Gabor <zgabor@code.hu>
1996-07-03 22:17:28 +00:00
Peter Wemm 0164b6d61b Make %CPU add up closer to 100%.. At least, it now agrees with top.. :-)
Pointed out by: bde
1996-06-29 10:25:31 +00:00
Peter Wemm 0cd02d20a1 Fix (I think) the %MEM count in 'ps -u'. It was bogusly taking the
vm_rssize (in pages, not bytes), then dividing (bogusly) by the page size,
then using that as a fraction of the total pages.
1996-06-29 08:04:05 +00:00
Poul-Henning Kamp 00d17f40da CLSIZE -> getpagesize() 1996-05-02 13:06:21 +00:00
Poul-Henning Kamp 3a91de068c Replace NBPG with getpagesize() 1996-05-02 08:37:16 +00:00
Sujal Patel c01bf97c1e Fix up the badly out of date struct proc's p_flags.
Flags aren't printed in hexadecimal, as documented.
1996-04-19 22:23:27 +00:00
Mike Pritchard e229ffb7e9 Correct some cross references and some path names. 1996-04-06 09:47:30 +00:00
Mike Pritchard f3c0267f19 Fix some incorrect locations in the FILES sections of some man pages. 1996-02-02 18:22:04 +00:00
Mike Pritchard b2496d93eb Use the correct buffer size from limits.h for the error buffer
passed to kvm_open.  Closes PR# 476.

Submitted by:	Jeffrey Hsu <hsu@freebsd.org>
1996-01-20 10:43:54 +00:00
Peter Wemm d007c60359 oops. I forgot to add the "[-U username]" option to the usage string. 1996-01-12 08:49:43 +00:00