icon Top 9 categories map      RocketAware > man pages >


Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.

The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Search all pages


By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Integer, Floating point, Matrix, Statistics, Boolean, ...

Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


RocketLink!--> Man page versions: OpenBSD FreeBSD Others

KVM_OPEN(3)               OpenBSD Programmer's Manual              KVM_OPEN(3)

     kvm_open, kvm_openfiles, kvm_close - initialize kernel virtual memory ac-

     #include <fcntl.h>
     #include <kvm.h>

     kvm_t *
     kvm_open(const char *execfile, const char *corefile, char *swapfile,
             int flags, const char *errstr);

     kvm_t *
     kvm_openfiles(const char *execfile, const char *corefile, char *swapfile,
             int flags, char *errbuf);

     kvm_close(kvm_t *kd);

     The functions kvm_open() and kvm_openfiles() return a descriptor used to
     access kernel virtual memory via the kvm(3) library routines.  Both ac-
     tive kernels and crash dumps are accessible through this interface.

     execfile is the executable image of the kernel being examined.  This file
     must contain a symbol table.  If this argument is NULL, the currently
     running system is assumed, which is indicated by _PATH_KSYMS, if it ex-
     ists, otherwise _PATH_UNIX is used.  Both are defined in <paths.h>.

     corefile is the kernel memory device file.  It can be either /dev/mem or
     a crash dump core generated by savecore(8).  If corefile is NULL, the de-
     fault indicated by _PATH_MEM from <paths.h> is used.

     swapfile should indicate the swap device.  If NULL, _PATH_DRUM from
     <paths.h> is used.

     The flags argument indicates read/write access as in open(2) and applies
     only to the core file.  Only O_RDONLY, O_WRONLY, and O_RDWR are permit-

     There are two open routines which differ only with respect to the error
     mechanism.  One provides backward compatibility with the SunOS kvm li-
     brary, while the other provides an improved error reporting framework.

     The kvm_open() function is the Sun kvm compatible open call.  Here, the
     errstr argument indicates how errors should be handled.  If it is NULL,
     no errors are reported and the application cannot know the specific na-
     ture of the failed kvm call.  If it is not NULL, errors are printed to
     stderr with errstr prepended to the message, as in perror(3).  Normally,
     the name of the program is used here.  The string is assumed to persist
     at least until the corresponding kvm_close() call.

     The kvm_openfiles() function provides BSD style error reporting.  Here,
     error messages are not printed out by the library.  Instead, the applica-
     tion obtains the error message corresponding to the most recent kvm li-
     brary call using kvm_geterr() (see kvm_geterr(3)).  The results are unde-
     fined if the most recent kvm call did not produce an error.  Since
     kvm_geterr() requires a kvm descriptor, but the open routines return NULL
     on failure, kvm_geterr() cannot be used to get the error message if open
     fails.  Thus, kvm_openfiles() will place any error message in the errbuf
     argument.  This buffer should be _POSIX2_LINE_MAX characters large (from

     The kvm_open() and kvm_openfiles() functions both return a descriptor to
     be used in all subsequent kvm library calls.  The library is fully re-en-
     trant.  On failure, NULL is returned, in which case kvm_openfiles()
     writes the error message into errbuf.

     The kvm_close() function returns 0 on success and -1 on failure.

     There should not be two open calls.  The ill-defined error semantics of
     the Sun library and the desire to have a backward-compatible library for
     BSD left little choice.

     open(2),  kvm(3),  kvm_getargv(3),  kvm_getenvv(3),  kvm_geterr(3),
     kvm_getprocs(3),  kvm_nlist(3),  kvm_read(3),  kvm_write(3)

OpenBSD 2.6                     April 19, 1994                               2

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.

(Corrections, notes, and links courtesy of RocketAware.com)

[Detailed Topics]
FreeBSD Sources for kvm_open(3) functions
OpenBSD sources for kvm_open(3)

[Overview Topics]

Up to: Memory blocks (Sometimes called "Byte Strings") - Memory blocks. Allocated, shared, mmaped, kernel et al

RocketLink!--> Man page versions: OpenBSD FreeBSD Others

Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > kvm_open.3/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments