1179185Sjb/*-
2179185Sjb * Copyright (c) 2008 John Birrell (jb@freebsd.org)
3179185Sjb * All rights reserved.
4179185Sjb *
5179185Sjb * Redistribution and use in source and binary forms, with or without
6179185Sjb * modification, are permitted provided that the following conditions
7179185Sjb * are met:
8179185Sjb * 1. Redistributions of source code must retain the above copyright
9179185Sjb *    notice, this list of conditions and the following disclaimer.
10179185Sjb * 2. Redistributions in binary form must reproduce the above copyright
11179185Sjb *    notice, this list of conditions and the following disclaimer in the
12179185Sjb *    documentation and/or other materials provided with the distribution.
13179185Sjb *
14179185Sjb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15179185Sjb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16179185Sjb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17179185Sjb * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18179185Sjb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19179185Sjb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20179185Sjb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21179185Sjb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22179185Sjb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23179185Sjb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24179185Sjb * SUCH DAMAGE.
25179185Sjb *
26179185Sjb * $FreeBSD$
27179185Sjb */
28179185Sjb
29179185Sjb#include <sys/cdefs.h>
30179185Sjb#include <sys/param.h>
31179185Sjb#include <sys/types.h>
32179185Sjb#include <sys/event.h>
33179185Sjb#include <sys/ptrace.h>
34210688Srpaulo#include <rtld_db.h>
35179185Sjb
36179185Sjb#include "libproc.h"
37179185Sjb
38179185Sjbstruct proc_handle {
39179185Sjb	pid_t	pid;			/* Process ID. */
40179185Sjb	int	kq;			/* Kernel event queue ID. */
41179185Sjb	int	flags;			/* Process flags. */
42179185Sjb	int	status;			/* Process status (PS_*). */
43210688Srpaulo	int	wstat;			/* Process wait status. */
44210688Srpaulo	rd_agent_t *rdap;		/* librtld_db agent */
45210688Srpaulo	rd_loadobj_t *rdobjs;
46210688Srpaulo	size_t	rdobjsz;
47210688Srpaulo	size_t	nobjs;
48210688Srpaulo	struct lwpstatus lwps;
49179185Sjb};
50179185Sjb
51210688Srpaulo#ifdef DEBUG
52210688Srpaulo#define DPRINTF(fmt, ...) 	warn(fmt, __VA_ARGS__)
53210688Srpaulo#else
54210688Srpaulo#define DPRINTF(fmt, ...)
55210688Srpaulo#endif
56