Commit Graph

168 Commits

Author SHA1 Message Date
jdolecek ef1ec2419d started(): don't assume that the field width is correct and recompute
it as needed

This fixes bogus output for cases like `ps -ao start=xx`, as reported by
Martin Macok of Undeground.cz on current-users@netbsd.org.
2002-01-21 23:01:55 +00:00
soren dc53bf3cba Sync getopt() / man page with actual getopt options. 2001-12-20 20:10:33 +00:00
wiz 8ee888f96f Properly quote punctuation. 2001-12-20 20:06:15 +00:00
wiz 3ebcdc5e43 Whitespace nits. 2001-12-20 19:31:48 +00:00
lukem b8a6769184 fix minor WARNS=2 2001-11-03 13:21:09 +00:00
lukem 725b21190a fix comment: "[]" are [square] brackets, "<>" are angle brackets 2001-08-24 06:37:03 +00:00
enami 48661b973f Print commands within angled brackets only if they are system processes.
Print other commands, like cc, cpp and as, within parentheres.
2001-08-24 01:48:22 +00:00
wiz 1e378c4c12 precede, not preceed. 2001-08-20 12:00:46 +00:00
christos c91b59d1de Print system processes/kernel threads as [kprocname] as top(1) does. 2001-08-07 14:46:09 +00:00
wiz 8c6310c4a3 Remove duplicate `if'. Noted by Geoff C. Wing in bin/13551. 2001-07-30 16:22:49 +00:00
matt c6458f33d8 Add a small optimizetion in savevars(). break out of the loop once needcomm
is set since setting it multiple times only wastes cpu time.
2001-07-20 21:59:58 +00:00
matt 68b3b7e9c7 Retrieve maxslp & uspace from kernel instead of using defines. Needed for
shared arm code.
2001-07-14 06:53:43 +00:00
sommerfeld d19e89a7c0 correct the description of paddr 2001-07-04 20:49:00 +00:00
cyber 428f40d685 If there were no processes to list, it meant that our criteria failed
and didnt match anything.  Dont make our caller think we succeeded.
2001-06-14 19:04:49 +00:00
enami 4aa8283eb7 Always initialize an auto variable. 2001-03-23 01:06:02 +00:00
itojun 58a9573963 do not update maxlen if realloc fails. 2001-03-20 19:05:11 +00:00
christos a396a72f84 clarify things a bit more (from hubertf) 2001-01-15 21:02:58 +00:00
christos 3141a5cc48 Really explain what parenthesized names mean and why we parenthesize names! 2001-01-15 17:57:14 +00:00
hubertf 9bb3e62b11 Document the meaning of commands shown in parantheses.
Patches submitted by Jeremy C. Reed <reed@reedmedia.net> in PR 11930.
2001-01-15 16:16:51 +00:00
itojun bc8fe00e2e KPTR/KPTR24 are using u_int64_t. commented by minoura 2001-01-09 01:21:59 +00:00
itojun adf3a0eef5 redo previous (simplify KPTR) 2001-01-08 18:03:45 +00:00
itojun 3410e7bd02 backout previous; did not compile on non-alpha 2001-01-08 17:55:28 +00:00
itojun a3c77f0437 simplify KPTR processing. 2001-01-08 17:18:24 +00:00
itojun f320afb26b address PR 11653. checked on alpha.
XXX supports 32bit and 64bit pointers only
2001-01-08 13:20:29 +00:00
simonb 0a7d3a1ff5 Add a K flag to the state information - K is for kernel thread or system
process (ie, P_SYSTEM set in p_flag).  The L flag (locked in core) is
only used for non-P_SYSTEM processes.
2000-10-23 05:54:06 +00:00
nathanw 904bfc5822 Update description of process flag 0x20000 to match reality:
P_NOCLDWAIT, not P_SSTEP.
2000-08-28 13:06:42 +00:00
mrg 8d4795719a remove include of <vm/vm.h> 2000-06-29 06:26:33 +00:00
simonb eb32670668 Remove the 'poip' (pageouts in progress) keyword from the manpage.
From PR bin/8843 by Brian Stark.
2000-06-24 07:43:22 +00:00
simonb 643cb3c341 Don't check namelist when choosing to use the sysctl interface. 2000-06-16 03:51:00 +00:00
simonb d530ee00d1 Fix handling of "ps U<user>" where <user> ended it 't' - now if the
first argument doesn't start with a '-' and ends in 't', the 't' only
gets converted to a 'T' (for listing processes on the current tty)
if it doesn't contain any other command line option characters that
take an argument.  Problem noticed by ITOH Yasufumi on tech-userlevel.

If the 'start' format was the last column, the width wouldn't be set
and started() output a zero length string instead of a string the right
length - fix header width calculations so the the last column is handled
the same all others.  This only showed up for 'start' because started()
knew that the column header is the same width and the field itself...

Update copyrights.
2000-06-08 13:30:39 +00:00
simonb 292b668867 Fix back-to-front assignment in tname() which meant that the column
width would never autosize past the header ("TT") width.  Problem
noticed by Geoff Wing.
2000-06-08 00:51:10 +00:00
simonb a98dd470c6 Calculate field widths on the fly so that all columns line up nicely
and make more effective use of screen real estate when some columns
(eg USER and VSZ) didn't need the full default width.
2000-06-07 04:57:59 +00:00
simonb a717560d21 G/C evar() - now that everything is in the one structure it was exactly
the same as pvar().
2000-06-02 03:39:02 +00:00
simonb fd521aefe9 Use new sysctl/kvm interfaces. This will stop the "proc size mismatch"
errors when internal kernel structures change size.  Also remove
the sgid bit - all live kernel data is accessed through the sysctl
interface.
2000-05-26 03:04:28 +00:00
thorpej 06b81d67f4 Handle SONPROC state. 2000-05-26 00:42:34 +00:00
mjl 4ecbad3425 Fix problem in option processing, would segfault when parsing "-O,".
Closes PR/10096 by Yuji Yamano using the patch provided.
2000-05-11 08:52:30 +00:00
abs 22cfbf2cbb If ps cannot get the terminal size from STDOUT, it tried STDERR and STDIN.
What this does to the POLS when a script that is parsing ps output just happens
to run in a narrow terminal cannot be described in polite company.
If STDOUT is not a tty, leave width at 80.
2000-04-29 00:18:48 +00:00
simonb 8384a1bbb8 Use tty "?" to select processes with no controlling tty and tty "-" to
select processes with a revoked controlling tty.

Idea from SunOS/Solaris, suggested by Alexis Rosen.
2000-04-15 04:40:46 +00:00
chs 233639846d make -M imply -K. the current system is not likely to be
a reasonable approximation of a crash dump.
2000-04-10 06:37:37 +00:00
jdolecek 13885bdfec Ignore also "self" link when searching for proc info.
Patch sent by NAKAJIMA Yoshihiro in bin/9819
2000-04-07 18:04:05 +00:00
dbj 00afbd6fd8 name database is kvm.db not kvm_netbsd.db 2000-02-22 06:47:27 +00:00
fredb f3ac07c89e Fix CL* purge fallout. 1999-12-05 18:33:28 +00:00
hubertf b8a04b1a7e Document -U switch (displays processes belonging to given user/uid).
Reported in PR 8943 by WL <wliao@dura.spc.uchicago.edu>
1999-12-04 01:23:09 +00:00
simonb e7f8f72d9d Since we have an "extern.h", put all external variable declarations in
that file and not sprinkled around various .c files.
1999-12-03 02:26:36 +00:00
simonb 5801c247fa "ps -e" only shows the environment for the processes owned by the
current user id or all process if run by root.

Fixes PR security/5967 from Todd Vierling.
1999-12-03 02:16:41 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
jdolecek a5ae7c6ca4 command(): don't start using procfs_getargv() instead of kvm_getargv()
just because the latter returned a NULL - that may normally happen,
when the process is, for example, a kernel thread

procfs_getargv(): if the name is brackened in '(' and ')', just
	return NULL immediately - the code in command() will DTRT
	and the output will be same for procfs- and kvm- based lookup
	in all cases
1999-10-15 20:39:52 +00:00
jdolecek e52880e76a getkinfo_kvm(): fix bug in previous - handled size_t i as if it would be signed
saveuser(): don't check kd - if we get here, kd is never NULL
1999-10-15 20:01:33 +00:00
jdolecek f848d2ec0c When using the procfs for extracting process information, extract
also process start time, process arguments and session leadership status.

The procfs fallback is also used when kvm_openfiles() completely fails
(e.g. when /dev/mem is not readable).

Solves PR 7772, though the final implementation is different.
1999-10-15 19:31:24 +00:00
mrg fdea8ae38f skip "dty" just like we skip "tty", otherwise we just get "dt" in ps output for all dty's 1999-10-11 09:18:09 +00:00