1/*
2 * Copyright (c) 2009 Todd C. Miller <millert@openbsd.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17struct fuser {
18	TAILQ_ENTRY(fuser) tq;
19	uid_t uid;
20	pid_t pid;
21	int flags;
22#define F_ROOT 0x01	/* is procs root directory */
23#define F_CWD  0x02	/* is procs cwd */
24#define F_OPEN 0x04	/* just has it open */
25#define F_TEXT 0x08	/* is procs executable text */
26};
27
28struct filearg {
29	SLIST_ENTRY(filearg) next;
30	dev_t dev;
31	ino_t ino;
32	char *name;
33	TAILQ_HEAD(fuserhead, fuser) fusers;
34};
35
36SLIST_HEAD(fileargs, filearg);
37
38extern int uflg;
39extern int cflg;
40extern int fsflg;
41extern int sflg;
42extern int signo;
43extern struct fileargs fileargs;
44
45extern char *__progname;
46
47void fuser_check(struct kinfo_file *);
48void fuser_run(void);
49void usage(void);
50