kvm_open.3 (127439) | kvm_open.3 (131504) |
---|---|
1.\" Copyright (c) 1992, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software developed by the Computer Systems 5.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract 6.\" BG 91-66 and contributed to Berkeley. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34.\" SUCH DAMAGE. 35.\" 36.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94 | 1.\" Copyright (c) 1992, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software developed by the Computer Systems 5.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract 6.\" BG 91-66 and contributed to Berkeley. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34.\" SUCH DAMAGE. 35.\" 36.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94 |
37.\" $FreeBSD: head/lib/libkvm/kvm_open.3 127439 2004-03-26 08:05:39Z ru $ | 37.\" $FreeBSD: head/lib/libkvm/kvm_open.3 131504 2004-07-02 23:52:20Z ru $ |
38.\" 39.Dd January 29, 2004 40.Dt KVM_OPEN 3 41.Os 42.Sh NAME 43.Nm kvm_open , 44.Nm kvm_openfiles , 45.Nm kvm_close --- 12 unchanged lines hidden (view full) --- 58.Sh DESCRIPTION 59The functions 60.Fn kvm_open 61and 62.Fn kvm_openfiles 63return a descriptor used to access kernel virtual memory 64via the 65.Xr kvm 3 | 38.\" 39.Dd January 29, 2004 40.Dt KVM_OPEN 3 41.Os 42.Sh NAME 43.Nm kvm_open , 44.Nm kvm_openfiles , 45.Nm kvm_close --- 12 unchanged lines hidden (view full) --- 58.Sh DESCRIPTION 59The functions 60.Fn kvm_open 61and 62.Fn kvm_openfiles 63return a descriptor used to access kernel virtual memory 64via the 65.Xr kvm 3 |
66library routines. Both active kernels and crash dumps are accessible | 66library routines. 67Both active kernels and crash dumps are accessible |
67through this interface. 68.Pp 69The 70.Fa execfile 71argument is the executable image of the kernel being examined. 72This file must contain a symbol table. 73If this argument is 74.Dv NULL , --- 41 unchanged lines hidden (view full) --- 116.Pp 117There are two open routines which differ only with respect to 118the error mechanism. 119One provides backward compatibility with the SunOS kvm library, while the 120other provides an improved error reporting framework. 121.Pp 122The 123.Fn kvm_open | 68through this interface. 69.Pp 70The 71.Fa execfile 72argument is the executable image of the kernel being examined. 73This file must contain a symbol table. 74If this argument is 75.Dv NULL , --- 41 unchanged lines hidden (view full) --- 117.Pp 118There are two open routines which differ only with respect to 119the error mechanism. 120One provides backward compatibility with the SunOS kvm library, while the 121other provides an improved error reporting framework. 122.Pp 123The 124.Fn kvm_open |
124function is the Sun kvm compatible open call. Here, the | 125function is the Sun kvm compatible open call. 126Here, the |
125.Fa errstr | 127.Fa errstr |
126argument indicates how errors should be handled. If it is | 128argument indicates how errors should be handled. 129If it is |
127.Dv NULL , 128no errors are reported and the application cannot know the 129specific nature of the failed kvm call. 130If it is not 131.Dv NULL , 132errors are printed to 133.Dv stderr 134with --- 24 unchanged lines hidden (view full) --- 159.Dv NULL 160on failure, 161.Fn kvm_geterr 162cannot be used to get the error message if open fails. 163Thus, 164.Fn kvm_openfiles 165will place any error message in the 166.Fa errbuf | 130.Dv NULL , 131no errors are reported and the application cannot know the 132specific nature of the failed kvm call. 133If it is not 134.Dv NULL , 135errors are printed to 136.Dv stderr 137with --- 24 unchanged lines hidden (view full) --- 162.Dv NULL 163on failure, 164.Fn kvm_geterr 165cannot be used to get the error message if open fails. 166Thus, 167.Fn kvm_openfiles 168will place any error message in the 169.Fa errbuf |
167argument. This buffer should be _POSIX2_LINE_MAX characters large (from | 170argument. 171This buffer should be _POSIX2_LINE_MAX characters large (from |
168<limits.h>). 169.Sh RETURN VALUES 170The 171.Fn kvm_open 172and 173.Fn kvm_openfiles 174functions both return a descriptor to be used 175in all subsequent kvm library calls. --- 4 unchanged lines hidden (view full) --- 180.Fn kvm_openfiles 181writes the error message into 182.Fa errbuf . 183.Pp 184The 185.Fn kvm_close 186function returns 0 on success and -1 on failure. 187.Sh BUGS | 172<limits.h>). 173.Sh RETURN VALUES 174The 175.Fn kvm_open 176and 177.Fn kvm_openfiles 178functions both return a descriptor to be used 179in all subsequent kvm library calls. --- 4 unchanged lines hidden (view full) --- 184.Fn kvm_openfiles 185writes the error message into 186.Fa errbuf . 187.Pp 188The 189.Fn kvm_close 190function returns 0 on success and -1 on failure. 191.Sh BUGS |
188There should not be two open calls. The ill-defined error semantics | 192There should not be two open calls. 193The ill-defined error semantics |
189of the Sun library and the desire to have a backward-compatible library 190for 191.Bx 192left little choice. 193.Sh SEE ALSO 194.Xr open 2 , 195.Xr kvm 3 , 196.Xr kvm_getargv 3 , 197.Xr kvm_getenvv 3 , 198.Xr kvm_geterr 3 , 199.Xr kvm_getprocs 3 , 200.Xr kvm_nlist 3 , 201.Xr kvm_read 3 , 202.Xr kvm_write 3 , 203.Xr kmem 4 , 204.Xr mem 4 | 194of the Sun library and the desire to have a backward-compatible library 195for 196.Bx 197left little choice. 198.Sh SEE ALSO 199.Xr open 2 , 200.Xr kvm 3 , 201.Xr kvm_getargv 3 , 202.Xr kvm_getenvv 3 , 203.Xr kvm_geterr 3 , 204.Xr kvm_getprocs 3 , 205.Xr kvm_nlist 3 , 206.Xr kvm_read 3 , 207.Xr kvm_write 3 , 208.Xr kmem 4 , 209.Xr mem 4 |