Commit Graph

139 Commits

Author SHA1 Message Date
Mark Murray
25bba4f6ad Depollute headers now that the VM headers DTRT. 2001-05-03 11:49:44 +00:00
Mark Murray
325a83b456 Compensate for header dethreading. 2001-05-01 08:39:23 +00:00
Brian Somers
52f8369e69 The sess column went away last December with v1.26 of keyword.c
Remove it from ``jfmt''.

Forgotten by: mckusick
2001-04-07 02:53:35 +00:00
Andrey A. Chernov
f59105eedb Small optimization: set use_ampm only when needed 2001-03-03 01:46:58 +00:00
Andrey A. Chernov
080175194f Use AM/PM time only when available in locale 2001-03-02 23:53:36 +00:00
John Baldwin
e0aa5ab718 - Catch up to new proc flags. 2001-01-24 12:59:50 +00:00
Kirk McKusick
1f7d250182 Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather
only scalar values and structures that are already part of the
kernel/user interface, specifically rusage and rtprio. It no
longer contains proc, session, pcred, ucred, procsig, vmspace,
pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If
any of these changed in size, ps, w, fstat, gcore, systat, and
top would all stop working. The new structure has over 200 bytes
of unassigned space for future values to be added, yet is nearly
100 bytes smaller per entry than the structure that it replaced.
2000-12-12 07:25:57 +00:00
Brian Somers
cf22dcfc33 Support multiple (comma separated) names as arguments to -U
PR: 11051
2000-09-26 01:03:16 +00:00
Will Andrews
f8c9c11c5c Fix the exit code for the case where nentries == 0; if a PID doesn't exist,
ps(1) should not be returning a success code (0), it should return an
error code (1).  This was fixed on OpenBSD over 3 years ago.

PR:		19069
Submitted by:	Jim Sloan <odinn@atlantabiker.net>
Reviewed by:	rwatson
2000-07-08 05:13:10 +00:00
Peter Wemm
602a69d61e Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.
Also, fix some indentation that got messed up somehow..
1999-11-17 12:52:42 +00:00
Poul-Henning Kamp
b9df5231ca Introduce commandline caching in the kernel.
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.
1999-11-16 20:31:58 +00:00
Kris Kennaway
bdfebd8480 Typo (appropiate -> appropriate)
Obtained from:	OpenBSD (inspired by)
1999-11-15 03:37:57 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Bill Paul
bb22740673 On FreeBSD/alpha, ps(1) does not correctly report process start times
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
1999-04-01 14:45:18 +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
Philippe Charnier
c9a8d1f4dd Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
Dima Ruban
6425bb4314 cosmetic change for optstring 1998-02-18 22:45:22 +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
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
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
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
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
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
Peter Wemm
73eb8310a9 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
Andrey A. Chernov
2bf4b9cf1f Change local to LC_ALL, there is no bitmask 1995-10-26 10:57:52 +00:00
Andrey A. Chernov
0c56c7b29c Add setlocale LC_CTYPE|LC_TIME 1995-10-23 21:06:31 +00:00
Rodney W. Grimes
2162b2d226 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
Joerg Wunsch
0fd510b71a 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
David Greenman
0ec663d53a Use kvm_uread instead of kvm_read to access the upages. 1994-10-18 04:27:46 +00:00
David Greenman
8b6f5f5f9f On second thought...back out previous commit. 1994-10-02 08:33:31 +00:00
David Greenman
793ced0e91 Include rtprio.h 1994-10-02 08:19:13 +00:00
David Greenman
89730b290a Added $Id$ 1994-09-24 02:59:15 +00:00
Rodney W. Grimes
4b88c807ea BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00