Commit Graph

109 Commits

Author SHA1 Message Date
rwatson
78bbdcc2c4 Adapt libkvm_getswapinfo() to make use of recently committed vm and swap
sysctls exporting swap information.  When running on a live kernel,
the sysctl's will now be used instead of kvm_read, allowing consumers of
this interface to run without privilege (setgid kmem).  Retain the
ability to run on coredumps, or on a kernel using kmem if explicitly
pointed at one.

A side effect of this change is that kvm_getswapinfo() is faster now in
the general case. If the SWIF_DUMP_TREE flag is given (pstat -ss does
this), the radix tree walker, which still uses kvm_read in any case, is
invoked, and therefore does require privilege.

Submitted by:	Thomas Moestl <tmoestl@gmx.net>
Reviewed by:	freebsd-audit
2001-02-23 18:49:16 +00:00
jake
0dc4d20fbd Catch up to new priority interface. 2001-02-12 00:21:38 +00:00
ru
8a6f8b5fe4 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
jhb
91e8162c0a Add a new item to kinfo_proc: ki_sflag to mirror p_sflag. 2001-01-24 12:49:52 +00:00
wollman
ff19d89bc6 Revert rev. 1.27. This file only included <sys/select.h> because of
brokenness introduced in <sys/select.h> rev. 1.8 which is now OBE.
<sys/tty.h> and <sys/selinfo.h> together do the right thing.
2001-01-20 03:02:46 +00:00
ru
3d8401c62e Prepare for mdoc(7)NG. 2001-01-16 09:08:22 +00:00
ben
cc8f3da609 Use macro API to <sys/queue.h> 2000-12-30 21:52:34 +00:00
mckusick
cba301121b 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
obrien
c2ee1dcc02 Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
alfred
71d563e06c remove unneded sys/ucred.h include 2000-11-30 18:34:08 +00:00
ru
a6f5d950d8 Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
green
b98ae04f64 Good, fixing the header showed incorrect usage of it! #define _KERNEL
here for the include of sys/select.h.
2000-08-06 17:03:09 +00:00
kris
4e7ee5ff5d Limit the amount of data copied to the error buffer to _POSIX2_LINE_MAX.
This is the documented size which the user-provided buffer must be.
2000-08-04 09:23:07 +00:00
kris
ab3a6fa241 Remove obsolete reference to /var/db/kvm_kernel.db
Reviewed by:	peter
2000-05-07 02:16:43 +00:00
phantom
46b3916daf Introduce .Lb macro to libkvm manpages.
Use .Pa macro for "enlighting" path
2000-04-22 16:10:12 +00:00
jlemon
68b8d52e43 Remove unneeded #include 2000-04-16 17:36:48 +00:00
nectar
4cb901960c Change the return value of kvm_read/kvm_write to be -1 on error, to
match the documented interface.

Previously it returned 0 on error.

PR:		bin/10511
2000-03-31 15:04:25 +00:00
obrien
cc06168002 -Wall, which caught a real bug where buflen wasn't being set properly. 2000-03-27 00:33:45 +00:00
peter
49ba463e5b Correct an error message presumably as a result of cut/paste.
kvm_getfiles() referred to itself as kvm_getprocs().
2000-02-18 16:39:00 +00:00
chris
72dd5f5031 Repair misspelled `.Pp' directive:
.PP -> .Pp
2000-02-14 01:35:15 +00:00
rgrimes
c127d0e61e Replace beforeinstall target with new variables used by .mk system.
Reviewed by:	marcel, and make world
2000-01-14 07:57:47 +00:00
bde
46f9930cf5 Fixed missing includes in synopsis. <sys/file.h> went missing when KERNEL
was not updated to _KERNEL.  Actually including <sys/file.h> as specified
never actually worked, since a prerequisite was missing.
2000-01-05 16:38:58 +00:00
peter
d53e4c1d80 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
peter
047fa82dd0 Use kldsym(2) to lookup symbol values. This avoids the kvm_mkdb juggling
and is module aware.  Yes, this means that kvm_nlist(3) will find symbols
in loaded modules.  The emulation of the nlist struct is pretty crude but
seems to work well enough for all the users in the tree that I found.
1999-12-27 07:14:58 +00:00
phk
9809b71a89 Report swapdevices as cdevs rather than bdevs.
Remove unused dev2budev() function.
1999-11-29 21:37:18 +00:00
phk
cc6b664e2e 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
peter
d4305bf955 Delete the sf (swapfile) arg to an internal function that used to point to
/dev/drum but has not been used for a LONG time.
Add $FreeBSD$
1999-10-11 05:01:17 +00:00
peter
aa72d76380 Install <kvm.h> from here (after repo copy) so it's all in one package. 1999-10-04 14:56:04 +00:00
peter
76f0c923fe $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
peter
d4e3ebaf0a $Id$ -> $FreeBSD$ 1999-08-27 23:45:13 +00:00
bde
1e9a248e26 Don't open the swap file. The open descriptor for it hasn't been used
for over 5 years since we switched to using procfs for kvm_uread().
This cleanup was motivated by recent breakage of the default swap file
(/dev/drum) when swapon() has not been called.
1999-08-25 03:01:54 +00:00
nik
f7a8bc4c04 Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
peter
280d1557df Tidy up references to <sys/rlist.h> and support for the old swap management
that went away in January.
1999-05-11 14:32:18 +00:00
bde
fbe37a582c Oops, the previous log message should have been:
Include <machine/ansi.h> so that this file is self-sufficient again.
Rev.1.6 doesn't do this as claimed unless <nlist.h> has nonstandard
pollution.

Cleaned up includes.
1999-04-10 03:49:43 +00:00
bde
b624ddd420 Declare mkstemps(). 1999-04-09 15:06:56 +00:00
gallatin
1972c6ba27 make libkvm capable of dealing with a crashdump on alphas
Reviewed by: Doug Rabson <dfr@nlsystems.com>
1999-03-12 14:47:33 +00:00
bde
989e487b34 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
dt
9fb9019141 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
dillon
4ddefa4315 Handle case where no swap is configured 1999-02-06 06:31:57 +00:00
bde
76aad88d08 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
dillon
850c26db34 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
bde
de58abe0f0 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
bde
5973235153 Fixed unsorting of SRCS and MAN3 in previous commit.
Sorted MLINKS.
1999-01-23 07:55:15 +00:00
bde
bc1d62ba58 Fixed unsorting of cross references in previous commit. 1999-01-23 07:34:56 +00:00
dillon
3434445aa2 Oops, forgot this. Needed by libkvm. 1999-01-23 04:58:35 +00:00
dillon
23112681aa Fix type-o's in manual 1999-01-22 11:03:55 +00:00
dillon
34551cfe05 Add SWIF_DEV_PREFIX flag to add "/dev/..." to device name. 1999-01-22 10:57:03 +00:00
dillon
247543f77e Implement kvm_getswapinfo() libkvm function. Will be used by
pstat, top, and systat.
1999-01-22 10:36:04 +00:00
bde
32cca8fd9b <sys/types.h> isn't a prerequisite for <kvm.h>. 1998-12-16 19:12:14 +00:00
bde
34629b4155 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