xref: /openbsd-src/lib/libkvm/kvm_geterr.3 (revision 86f9d4cdda0e0267dccd8755ac0035525579c4a7)
1*86f9d4cdStedu.\"	$OpenBSD: kvm_geterr.3,v 1.9 2013/06/05 03:40:26 tedu Exp $
215f0ebb0Sderaadt.\"	$NetBSD: kvm_geterr.3,v 1.2 1996/03/18 22:33:20 thorpej Exp $
315f0ebb0Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1992, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" This code is derived from software developed by the Computer Systems
8df930be7Sderaadt.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract
9df930be7Sderaadt.\" BG 91-66 and contributed to Berkeley.
10df930be7Sderaadt.\"
11df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
12df930be7Sderaadt.\" modification, are permitted provided that the following conditions
13df930be7Sderaadt.\" are met:
14df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
15df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
16df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
17df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
18df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
196580fee3Smillert.\" 3. Neither the name of the University nor the names of its contributors
20df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
21df930be7Sderaadt.\"    without specific prior written permission.
22df930be7Sderaadt.\"
23df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33df930be7Sderaadt.\" SUCH DAMAGE.
34df930be7Sderaadt.\"
35df930be7Sderaadt.\"     @(#)kvm_geterr.3	8.1 (Berkeley) 6/4/93
36df930be7Sderaadt.\"
37*86f9d4cdStedu.Dd $Mdocdate: June 5 2013 $
38df930be7Sderaadt.Dt KVM_GETERR 3
39df930be7Sderaadt.Os
40df930be7Sderaadt.Sh NAME
41df930be7Sderaadt.Nm kvm_geterr
42df930be7Sderaadt.Nd get error message on kvm descriptor
43df930be7Sderaadt.Sh SYNOPSIS
44*86f9d4cdStedu.In kvm.h
45df930be7Sderaadt.Ft char *
46df930be7Sderaadt.Fn kvm_geterr "kvm_t *kd"
47df930be7Sderaadt.Sh DESCRIPTION
48df930be7SderaadtThis function returns a string describing the most recent error condition
49df930be7Sderaadton the descriptor
50df930be7Sderaadt.Fa kd .
51df930be7SderaadtThe results are undefined if the most recent
52df930be7Sderaadt.Xr kvm 3
53df930be7Sderaadtlibrary call did not produce an error.
54df930be7SderaadtThe string returned is stored in memory owned by
55df930be7Sderaadt.Xr kvm 3
56df930be7Sderaadtso the message should be copied out and saved elsewhere if necessary.
57df930be7Sderaadt.Sh SEE ALSO
58df930be7Sderaadt.Xr kvm 3 ,
59df930be7Sderaadt.Xr kvm_close 3 ,
60df930be7Sderaadt.Xr kvm_getprocs 3 ,
61df930be7Sderaadt.Xr kvm_nlist 3 ,
62df930be7Sderaadt.Xr kvm_open 3 ,
63376bc393Sjmc.Xr kvm_read 3
64cdafad35Sjmc.Sh BUGS
65cdafad35SjmcThis routine cannot be used to access error conditions due to a failed
66376bc393Sjmc.Xr kvm_openfiles 3
67cdafad35Sjmccall, since failure is indicated by returning a
68cdafad35Sjmc.Dv NULL
69cdafad35Sjmcdescriptor.
70cdafad35SjmcTherefore, errors on open are output to the special error buffer
71cdafad35Sjmcpassed to
72376bc393Sjmc.Xr kvm_openfiles 3 .
73cdafad35SjmcThis option is not available to
74376bc393Sjmc.Xr kvm_open 3 .
75