kvm.h revision 43282
11539Srgrimes/*-
21539Srgrimes * Copyright (c) 1989, 1993
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
131539Srgrimes * 3. All advertising materials mentioning features or use of this software
141539Srgrimes *    must display the following acknowledgement:
151539Srgrimes *	This product includes software developed by the University of
161539Srgrimes *	California, Berkeley and its contributors.
171539Srgrimes * 4. Neither the name of the University nor the names of its contributors
181539Srgrimes *    may be used to endorse or promote products derived from this software
191539Srgrimes *    without specific prior written permission.
201539Srgrimes *
211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311539Srgrimes * SUCH DAMAGE.
321539Srgrimes *
331539Srgrimes *	@(#)kvm.h	8.1 (Berkeley) 6/2/93
3443282Sbde *	$Id: kvm.h,v 1.7 1999/01/23 04:58:35 dillon Exp $
351539Srgrimes */
361539Srgrimes
371539Srgrimes#ifndef _KVM_H_
381539Srgrimes#define	_KVM_H_
391539Srgrimes
401539Srgrimes/* Default version symbol. */
411539Srgrimes#define	VRS_SYM		"_version"
421539Srgrimes#define	VRS_KEY		"VERSION"
431539Srgrimes
441539Srgrimes#include <nlist.h>
451539Srgrimes#include <sys/cdefs.h>
461539Srgrimes
4741882Sbde#ifdef	_BSD_SIZE_T_
4841882Sbdetypedef	_BSD_SIZE_T_	size_t;
4941882Sbde#undef	_BSD_SIZE_T_
5041882Sbde#endif
511539Srgrimes
5241882Sbde#ifdef	_BSD_SSIZE_T_
5341882Sbdetypedef	_BSD_SSIZE_T_	ssize_t;
5441882Sbde#undef	_BSD_SSIZE_T_
5541882Sbde#endif
5641882Sbde
571539Srgrimestypedef struct __kvm kvm_t;
581539Srgrimes
591539Srgrimesstruct kinfo_proc;
6041882Sbdestruct proc;
6141882Sbde
6243282Sbdestruct kvm_swap {
6343085Sdillon	char	ksw_devname[32];
6443085Sdillon	int	ksw_used;
6543085Sdillon	int	ksw_total;
6643085Sdillon	int	ksw_flags;
6743085Sdillon	int	ksw_reserved1;
6843085Sdillon	int	ksw_reserved2;
6943282Sbde};
7043085Sdillon
7143085Sdillon#define SWIF_DUMP_TREE	0x0001
7243085Sdillon#define SWIF_DEV_PREFIX	0x0002
7343085Sdillon
7441882Sbde__BEGIN_DECLS
751539Srgrimesint	  kvm_close __P((kvm_t *));
761539Srgrimeschar	**kvm_getargv __P((kvm_t *, const struct kinfo_proc *, int));
771539Srgrimeschar	**kvm_getenvv __P((kvm_t *, const struct kinfo_proc *, int));
781539Srgrimeschar	 *kvm_geterr __P((kvm_t *));
7943282Sbdechar	 *kvm_getfiles __P((kvm_t *, int, int, int *));
801539Srgrimesint	  kvm_getloadavg __P((kvm_t *, double [], int));
811539Srgrimesstruct kinfo_proc *
821539Srgrimes	  kvm_getprocs __P((kvm_t *, int, int, int *));
8343282Sbdeint	  kvm_getswapinfo __P((kvm_t *, struct kvm_swap *, int, int));
841539Srgrimesint	  kvm_nlist __P((kvm_t *, struct nlist *));
851539Srgrimeskvm_t	 *kvm_open
861539Srgrimes	    __P((const char *, const char *, const char *, int, const char *));
871539Srgrimeskvm_t	 *kvm_openfiles
881539Srgrimes	    __P((const char *, const char *, const char *, int, char *));
8939353Sdfrssize_t	  kvm_read __P((kvm_t *, unsigned long, void *, size_t));
9041882Sbdessize_t	  kvm_uread
9141882Sbde	    __P((kvm_t *, const struct proc *, unsigned long, char *, size_t));
9239353Sdfrssize_t	  kvm_write __P((kvm_t *, unsigned long, const void *, size_t));
931539Srgrimes__END_DECLS
941539Srgrimes
951539Srgrimes#endif /* !_KVM_H_ */
96