MirBSD manpage: kvm_dump(3), kvm_dump_inval(3), kvm_dump_mkheader(3), kvm_dump_wrtheader(3)

KVM_DUMP(3)                BSD Programmer's Manual                 KVM_DUMP(3)


     kvm_dump_mkheader, kvm_dump_wrtheader, kvm_dump_inval - crash dump sup-
     port functions


     #include <kvm.h>

     kvm_dump_mkheader(kvm_t *kd, off_t dump_off);

     kvm_dump_wrtheader(kvm_t *kd, FILE *fp, int dumpsize);

     kvm_dump_inval(kvm_t *kd);


     First note that the functions described here were designed to be used by

     The function kvm_dump_mkheader() checks if the physical memory file asso-
     ciated with kd contains a valid crash dump header as generated by a dump-
     ing kernel. When a valid header is found, kvm_dump_mkheader() initializes
     the internal kvm data structures as if a crash dump generated by the
     savecore(8) program was opened. This has the intentional side effect of
     enabling the address translation machinery.

     A call to kvm_dump_mkheader() will most likely be followed by a call to
     kvm_dump_wrtheader(). This function takes care of generating the generic
     header, the CORE_CPU section and the section header of the CORE_DATA sec-
     tion. The data is written to the file pointed at by fp. The dumpsize ar-
     gument is only used to properly set the segment size of the CORE_DATA
     section. Note that this function assumes that fp is positioned at file
     location 0. This function will not seek and therefore allows fp to be a
     file pointer obtained by zopen().

     The kvm_dump_inval() function clears the magic number in the physical
     memory file associated with kd. The address translations must be enabled
     for this to work (thus assuming that kvm_dump_mkheader() was called ear-
     lier in the sequence).


     All functions return 0 on success, -1 on failure. In the case of failure,
     kvm_geterr(3) can be used to retrieve the cause of the error.




     These functions first appeared in NetBSD 1.1A.

MirBSD #10-current              March 17, 1996                               1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung