Commit Graph

275 Commits

Author SHA1 Message Date
phk
1a1b91e398 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
bde
846df0ccd8 Fixed printf format errors (second round with non-i386 typedefs). 1998-06-28 21:05:48 +00:00
bde
ae0ea8e208 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
bde
cd369d3872 Fixed printf format errors. 1998-06-28 18:19:13 +00:00
jkoshy
9ae2dba8f6 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
jkoshy
fb4783cb34 Fix errors that crept into the previous commit. 1998-06-04 07:02:59 +00:00
jkoshy
324c3d8c89 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
bde
aa0dee5e71 Fixed imperfections in previous commit (a poor variable name,
excessive 64-bit arithmetic, and excessive changes).
1998-05-31 12:09:50 +00:00
phk
69ad703802 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
846f9321d4 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
charnier
80458a8e0a Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
dima
ecf2a65e4c Add 'f' flag to the optstring. 1998-02-18 22:49:58 +00:00
dima
3d91e52df3 cosmetic change for optstring 1998-02-18 22:45:22 +00:00
dyson
ccb56de039 Display VSZ much more accurately now. 1998-02-02 05:16:42 +00:00
dyson
44ee994858 Document the new -f flag.
PR:	5196
Submitted by:	Matt Dillon <dillon@best.net>
1997-12-05 07:35:31 +00:00
dyson
7df966457d 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
jlemon
b5bff2d390 Document correct option in manual page.
PR:		3769
Submitted by:	johnp@lodgenet.com
1997-08-19 21:52:07 +00:00
steve
89684c8d1d 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
532601c3fa Oops, add #include's (forgotten in last commit) to make this
compile again.
1997-08-11 02:41:02 +00:00
steve
020120ed08 Use -I../../sys instead of -I/sys. 1997-08-11 02:36:09 +00:00
steve
7b560b7a4e Remove #ifdef NEWVM code and remove extra "key.name = p" line. 1997-08-11 02:35:16 +00:00
steve
aae937eff0 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
4798973d71 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
c8da6d7fe6 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
bde
d04c5a7006 devname.c moved to libc before Lite1 and isn't in ps in Lite2. 1997-07-13 07:43:41 +00:00
charnier
3f6611f8d3 Cosmetic change in usage string. 1997-06-06 06:40:06 +00:00
jkh
6fbecfb144 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
jdp
ce525b762d 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
imp
cdc0e920d8 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
ee328d1053 Fix buffer overflow (probably unexploitable). 1997-03-10 19:10:08 +00:00
ache
ef8eca45e6 Big usernames fixes 1997-03-04 00:33:56 +00:00
ache
d653dc5901 Use MAXLOGNAME-1 for width because MAXLOGNAME includes NUL 1997-03-03 08:20:28 +00:00
peter
34fd560164 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
9c0cd3f9df 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
d20174939c -Wall cleaning. 1996-12-14 06:08:03 +00:00
hsu
7256defd22 Remove unneeded #include <sys/proc.h>. 1996-11-10 06:13:12 +00:00
peter
94d11dbaaf 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
dg
78821ab874 Updated to match kernel changes for timer/run queue. 1996-07-31 09:27:23 +00:00
mpp
c336415f2a 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
94fb710c77 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
8facdff20e 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
phk
e2bbf084a5 CLSIZE -> getpagesize() 1996-05-02 13:06:21 +00:00
phk
201f1269c8 Replace NBPG with getpagesize() 1996-05-02 08:37:16 +00:00
smpatel
20e67baee3 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
mpp
e6d2f2986f Correct some cross references and some path names. 1996-04-06 09:47:30 +00:00
mpp
98bcf4c755 Fix some incorrect locations in the FILES sections of some man pages. 1996-02-02 18:22:04 +00:00
mpp
049661b89b 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
d7b348d79e oops. I forgot to add the "[-U username]" option to the usage string. 1996-01-12 08:49:43 +00:00
joerg
b47c269c8d Small man page tweaks:
. mention the need for procfs
. make it clear that default sorting is first by ctty, then by PID

Submitted by: schweikh@ito.uni-stuttgart.de (Jens Schweikhardt)
1995-12-30 13:52:02 +00:00
peter
9b80d26c22 Implement a new option to ps.. `-U username'. This allows you to
list the processes belonging to a particular user without having to use
`-u' and grepping for the username.  Basically you can now get a short
`ps -x' like list (with more space for the command) for other users.
1995-12-26 03:38:55 +00:00
phk
1acffefabf I add #include <sys/user.h> 1995-10-28 20:11:18 +00:00
ache
1ffe3ce1a3 Change local to LC_ALL, there is no bitmask 1995-10-26 10:57:52 +00:00
torstenb
e9d3587ad5 fix bad dependencies (LIBMATH -> LIBM) 1995-10-25 15:08:21 +00:00
ache
c525beefdf Add setlocale LC_CTYPE|LC_TIME 1995-10-23 21:06:31 +00:00
ache
44c7c30479 Remove unneded ctype.h 1995-10-23 21:03:40 +00:00
peter
69c296a7e8 Correct the alignment of the tty column, which was affected by my change to
allow more than two tty characters.

David Greenman pointed out that when a process that had been revoked from
it's controlling tty, the "-" sign was detached from any two-character
names.
1995-09-26 17:48:59 +00:00
peter
bbe961035e Increase the tty column width from 2 to 3 characters.
This gives us more room to breath with tty names, especially with drivers
that support large numbers of ports..  eg: specialix and digiboard.

This does not actually change the current tty names, it just allows room
for reporting more characters if the drivers use them.
1995-09-04 01:22:54 +00:00
wollman
01cdce9796 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00
rgrimes
e6999472c1 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
dg
43d095fa58 Install with default BINOWN (as it once used to be). 1995-04-15 03:31:19 +00:00
dg
920072075e Install setgid kmem rather than setuid root. The problem with procfs that
was breaking this before has been fixed.
1995-04-15 03:25:52 +00:00
joerg
6330608063 You will find enclosed some changes to make gcc -Wall more happy in
/usr/src/bin. Note that some patches are still needed in that directory.

I (Joerg) finished most of Philippe's cleanup.  /bin/sh will still
need *allot* of work, however.

Submitted by:	charnier@lirmm.fr (Philippe Charnier)
1995-03-19 13:29:28 +00:00
dg
9da64cb991 Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.
1995-03-09 20:40:17 +00:00
dg
6b18c49795 Re-apply an old patchkit days fix of mine for mempages:
* PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
 * --------------------         -----   ----------------------
 * CURRENT PATCH LEVEL:         1       00051
 * --------------------         -----   ----------------------
 *
 * 14 Aug 92    David Greenman          Fixed NEWVM mempages calculation
1994-11-24 13:13:55 +00:00
ats
001b6339d8 Fix an error to prevent some core dumps from ps.
You can get ps easily to core dump, if you are running a "make depend"
on a kernel in one window and a "ps -auxww" in another. The ww will
try to give you the full argument list of the command that can
now be 64Kb large, but ps expected only 4Kb large arg arrays and
doesn't check for overflows.
1994-11-10 23:25:12 +00:00
dg
e52605bf0c Use kvm_uread instead of kvm_read to access the upages. 1994-10-18 04:27:46 +00:00
ache
368a575df4 Skip 'cua' 3 chars like 'tty' 3 chars 1994-10-02 14:11:32 +00:00
dg
181c07d49f On second thought...back out previous commit. 1994-10-02 08:33:31 +00:00
dg
f6ae6137af Include rtprio.h 1994-10-02 08:19:13 +00:00
dg
00eb2a4dc0 Added $Id$ 1994-09-24 02:59:15 +00:00
dg
717ba38308 Added rtprio option/field.
Submitted by:	Henrik Vestergaard Draboel
1994-09-01 11:28:45 +00:00
dg
7d3dc7b350 Got rid of extra space between args and (command). 1994-08-18 14:30:53 +00:00
wollman
cccfb9e175 Make `ps' set-uid root so that it can read the same set of arguments
that old `ps'es did.  I'm not too thrilled about this, but I'm not
enough of an FS person to hack procfs so that /proc/xxx/mem is readable
by members of group `kmem'.  If this is done, then `ps' can go back to
being set-gid kmem.
1994-08-11 20:06:55 +00:00
dg
17e7606224 Converted 'vmunix' to 'kernel'. 1994-08-05 09:14:37 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00