Commit Graph

72 Commits

Author SHA1 Message Date
Bruce Evans
114d756447 Don't use u_long in the synopsis, since u_long is not part of the kvm
interface.
1999-03-05 17:32:53 +00:00
Dmitrij Tejblum
bd54ec1edf From rev. 1.12 of usr.sbin/pstat/pstat.c by phk:
Reflect the fact that we do not swap on the first <dmmax> blocks of a
swapdev, to protect disklabels and other such magic stuff.
1999-02-14 21:42:05 +00:00
Matthew Dillon
f3401d0c26 Handle case where no swap is configured 1999-02-06 06:31:57 +00:00
Bruce Evans
45908a6a19 Removed evil typedef kvm_swap_t and all uses of it (not many).
Hoped for by:	wollman
1999-01-27 11:29:15 +00:00
Matthew Dillon
876c5c1135 Fix swap radix tree dump formatting ( pstat -ss ), it was printing the
wrong radix for recursive subnodes.
1999-01-25 04:07:07 +00:00
Bruce Evans
9bcaf304c6 Fixed missing cross reference to kvm_getfiles.
This man page may be overdoing the cross references by referencing
man pages that are just links to other pages that are referenced.

kvm_uread() is still completely undocumented in kvm*.3.
1999-01-23 08:12:12 +00:00
Bruce Evans
8bb84da720 Fixed unsorting of SRCS and MAN3 in previous commit.
Sorted MLINKS.
1999-01-23 07:55:15 +00:00
Bruce Evans
9457cf9c59 Fixed unsorting of cross references in previous commit. 1999-01-23 07:34:56 +00:00
Matthew Dillon
b8808468dd Oops, forgot this. Needed by libkvm. 1999-01-23 04:58:35 +00:00
Matthew Dillon
6a389e5182 Fix type-o's in manual 1999-01-22 11:03:55 +00:00
Matthew Dillon
a14dedd13c Add SWIF_DEV_PREFIX flag to add "/dev/..." to device name. 1999-01-22 10:57:03 +00:00
Matthew Dillon
e92324a21e Implement kvm_getswapinfo() libkvm function. Will be used by
pstat, top, and systat.
1999-01-22 10:36:04 +00:00
Bruce Evans
bc701368b4 <sys/types.h> isn't a prerequisite for <kvm.h>. 1998-12-16 19:12:14 +00:00
Bruce Evans
424a876474 The previous commit was bogus. <stdlib.h> was never a prerequisite
for <kvm.h> or kvm_getloadavg(), and <sys/types.h> was only a
prerequisite for <kvm.h> when <kvm.h> was broken.
1998-12-16 19:04:54 +00:00
Bruce Evans
b245b90a64 Declare size_t and ssize_t if they are not already declared, so that
<kvm.h> is self-sufficient again.

Moved typedefs and forward struct declarations out of __BEGIN_DECLS/
__END_DECLS.

Don't comment out the prototype for kvm_uread().  This was a 4 year
old kludge for previous breakage of self-sufficiency.  The prototypwe
was broken instead.

Fixed bitrot (const poisoning) in the type of kvm_uread().

Fixed order of the declaration of kvm_uread().
1998-12-16 18:59:47 +00:00
Bruce Evans
60160c5e50 Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This
fixes a type mismatch in the call to kvm_uread().  The bug has gone
undetected for almost 3 years because kvm_uproc()'s protoype has been
disabled for almost 4 years.

Trust sysctlbyname() to work properly if it succeeds.

Fixed style bugs in revs. 1.19 and 1.22.
1998-12-16 18:31:51 +00:00
Matthew Dillon
36058b68da Add required #include references to manual page 1998-12-13 02:32:59 +00:00
Dag-Erling Smørgrav
b2d3d0f097 Avoid the "Cannot allocate memory" problem that appears on heavily
loaded systems by retrying the sysctl() with a larger buffer if it
fails with ENOMEM. For good measure, allocate 10% more memory than
sysctl() claims is necessary.

PR:		8275
Reviewed by:	David Greenman <dg@freebsd.org>
1998-10-12 20:36:33 +00:00
Doug Rabson
4fab6203a9 Adjust the declarations of kvm_read and kvm_write to match reality a little
closer.
1998-09-16 09:30:14 +00:00
Warner Losh
e8420087b0 Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
1998-09-16 04:17:47 +00:00
KATO Takenori
d7feb25bdf Change ${MACHINE} into ${MACHINE_ARCH} to support MACHINE=pc98. 1998-09-09 11:27:33 +00:00
Doug Rabson
c2ac238c40 The length argument to sysctl is now size_t. 1998-08-25 07:52:33 +00:00
Gary Palmer
253ab58f6f Nuke unsupported architecture files 1998-08-22 14:34:59 +00:00
Doug Rabson
36fe61fe12 Add an alpha machdep for kvm. The vatop functions are stubbed out for
now (mainly because I haven't ported them from the NetBSD crash dump
environment).

Obtained from: NetBSD
1998-08-15 12:12:22 +00:00
Poul-Henning Kamp
35e6b695d6 Allow /dev/null as path for the "/dev/mem" file, and assume that people
know what they're doing if they do that.  This will allow ps to use
the kvm_proc.c bits without having access to /dev/mem.

Fix kvm_proc.c to not need /dev/mem for access to argv/envp
1998-06-30 21:29:44 +00:00
Bruce Evans
d7fb4b13b9 Fixed bugs in the conversion of kvm to to use procfs in rev.1.3. All
are in kvm_uread():
- the setting of errno before checking it in the lseek() was lost.
- EOF handling was lost.  kvm_uread() retried forever on EOF.  EOF is
  not really an error, but report it one as in rev.1.2.
- reporting of errno after a read error was lost.

Fixed style bugs in rev.1.3 and rev.1.12.

Not fixed: errno is not reported after lseek() failures.
1998-01-16 16:45:05 +00:00
Bruce Evans
30a72f72d5 -I${DESTDIR}/sys -> -I${.CURDIR}/../../sys. 1997-08-26 14:13:02 +00:00
Tor Egge
4afb0d5a5b Copy code from gnu/usr.bin/gdb/gdb/kvm-fbsd.c to deal with 4 MB pages. 1997-08-17 17:42:59 +00:00
Satoshi Asami
688034bb93 Add ${DESTDIR} in front of absolute path. 1997-07-18 06:32:39 +00:00
Tor Egge
a58930d8a9 Fill in parent process id when reading process information from a
memory dump. This fixes one of the problems noted in PR kern/3581.
1997-06-25 20:56:48 +00:00
Bruce Evans
a3315650db Fixed #include and/or prototype bugs in synopsis. 1997-04-19 15:57:20 +00:00
Bruce Evans
77667e9e45 Fixed #include and/or prototype bugs in synopsis. 1997-04-13 14:10:05 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Wolfram Schneider
75141cc987 Sort cross references. 1997-01-20 23:23:22 +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
Mike Pritchard
7eb461278e Fix the short description of kvm_getloadavg(3) to reflect
what the function really does.

Also fix a small mdoc problem I noticed while in there.

Obtained from: NetBSD-bugs (NetBSD PR#3077)
1997-01-02 20:16:20 +00:00
Andrey A. Chernov
d7b100f932 kvm_malloc:
When malloc fails. don't try to memset NULL pointer, it cause core dump
Replace malloc+memset with calloc, theoretically it can do some
optimization of zeroing process internally
Improve error diagnostic
1996-11-11 08:28:47 +00:00
Peter Wemm
2f85bf6e8e Implement virtual-to-physical address mapping for the kvm library on
dead kernel debugging.  The previous code was a "do nothing".

The most obvious side effect of this is that you can now do things like
this and reasonably expect them to work:
  dmesg -M /var/crash/vmcore.3 -N /var/crash/kernel.3
  ps -axl -M /var/crash/vmcore.3 -N /var/crash/kernel.3

A good deal of this was lifted from the gdb code to do this, as well as
from NetBSD's libkvm (which has completely different VM macros)
1996-10-07 20:17:50 +00:00
Jordan K. Hubbard
51295a4d3e General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00
Poul-Henning Kamp
44ffb5f593 Pass correct length OID to kernel for KERN_PROC_ALL. 1996-06-06 17:16:52 +00:00
Poul-Henning Kamp
2572133ed3 NBPG -> PAGE_SIZE 1996-05-02 09:23:36 +00:00
Jeffrey Hsu
37e4fbc4cb From Lite2: proc and file LIST changes 1996-03-11 05:34:46 +00:00
Peter Wemm
7350dd84a0 If the two recently added sysctl variables exist, use those rather than
the statically compiled PS_STRINGS and USRSTACK variables.  This prevents
programs using setproctitle from coredumping if the kernel VM is increased,
and stops libkvm users (w, ps, etc) from needing to be recompiled if only
the VM layout changes.
1996-02-24 14:37:30 +00:00
Mike Pritchard
6fad16fd59 Add some missing MLINKS, correct some cross references, correct some
file locations and some minor formatting/style problems.
1996-02-09 16:20:10 +00:00
Mike Pritchard
e2cc67ef3c Another round of spelling fixes. 1996-01-30 18:13:11 +00:00
Peter Wemm
b8321444f8 Extract the login name when doing a ps on a dead kernel. 1996-01-01 17:08:17 +00:00
Peter Wemm
6b492ae46d Cosmetic cleanup and documentation of kvm_argv.. Hopefully the flow of
the routine can be much more easily understood now... :-)
1995-12-16 09:25:17 +00:00
Peter Wemm
a52219bb33 phkmalloc strikes again! :-) Another use of un-cleared returns from
malloc squashed...
1995-12-09 04:45:50 +00:00
Peter Wemm
77721f53be Updates to read the extra indirection in ps_strings. Note that any
static executables that depend on this will need to be relinked (ie: do
this before 'ps'), but the dynamic linked stuff should be OK (ie: 'w')

Obtained from: NetBSD (not much point reinventing the wheel.. :-)
1995-12-09 04:42:51 +00:00
Bruce Evans
5e0a7c7c40 Removed unnecessary include of <sys/tty.h>. tty.h apparently once had
some user interfaces in it.  It no longer does.
1995-10-22 18:52:23 +00:00