compat_util.h revision 1.22 1 1.22 mrg /* $NetBSD: compat_util.h,v 1.22 2009/12/14 04:09:38 mrg Exp $ */
2 1.4 christos
3 1.4 christos /*-
4 1.4 christos * Copyright (c) 1994 The NetBSD Foundation, Inc.
5 1.4 christos * All rights reserved.
6 1.4 christos *
7 1.4 christos * This code is derived from software contributed to The NetBSD Foundation
8 1.4 christos * by Christos Zoulas.
9 1.4 christos *
10 1.4 christos * Redistribution and use in source and binary forms, with or without
11 1.4 christos * modification, are permitted provided that the following conditions
12 1.4 christos * are met:
13 1.4 christos * 1. Redistributions of source code must retain the above copyright
14 1.4 christos * notice, this list of conditions and the following disclaimer.
15 1.4 christos * 2. Redistributions in binary form must reproduce the above copyright
16 1.4 christos * notice, this list of conditions and the following disclaimer in the
17 1.4 christos * documentation and/or other materials provided with the distribution.
18 1.4 christos *
19 1.4 christos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.4 christos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.4 christos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.4 christos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.4 christos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.4 christos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.4 christos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.4 christos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.4 christos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.4 christos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.4 christos * POSSIBILITY OF SUCH DAMAGE.
30 1.4 christos */
31 1.1 christos
32 1.1 christos /*
33 1.1 christos * Copyright (c) 1995 Frank van der Linden
34 1.22 mrg * Copyright (c) 2009 Matthew R. Green
35 1.1 christos * All rights reserved.
36 1.1 christos *
37 1.1 christos * Redistribution and use in source and binary forms, with or without
38 1.1 christos * modification, are permitted provided that the following conditions
39 1.1 christos * are met:
40 1.1 christos * 1. Redistributions of source code must retain the above copyright
41 1.1 christos * notice, this list of conditions and the following disclaimer.
42 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright
43 1.1 christos * notice, this list of conditions and the following disclaimer in the
44 1.1 christos * documentation and/or other materials provided with the distribution.
45 1.1 christos * 3. The name of the author may not be used to endorse or promote products
46 1.1 christos * derived from this software without specific prior written permission
47 1.1 christos *
48 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
49 1.1 christos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
50 1.1 christos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 1.1 christos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
52 1.1 christos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53 1.1 christos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
54 1.1 christos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
55 1.1 christos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56 1.1 christos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
57 1.1 christos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 1.1 christos *
59 1.1 christos */
60 1.1 christos
61 1.1 christos #ifndef _COMPAT_UTIL_H_
62 1.1 christos #define _COMPAT_UTIL_H_
63 1.1 christos
64 1.2 thorpej struct emul;
65 1.2 thorpej struct proc;
66 1.18 dsl struct exec_package;
67 1.1 christos
68 1.6 cgd struct emul_flags_xtab {
69 1.6 cgd unsigned long omask;
70 1.6 cgd unsigned long oval;
71 1.6 cgd unsigned long nval;
72 1.6 cgd };
73 1.6 cgd
74 1.18 dsl void emul_find_root(struct lwp *, struct exec_package *);
75 1.12 jdolecek
76 1.18 dsl int emul_find_interp(struct lwp *, struct exec_package *, const char *);
77 1.6 cgd
78 1.6 cgd unsigned long emul_flags_translate(const struct emul_flags_xtab *tab,
79 1.6 cgd unsigned long in, unsigned long *leftover);
80 1.3 fvdl
81 1.15 christos void compat_offseterr(struct vnode *, const char *);
82 1.1 christos
83 1.22 mrg int compat_elf_check_interp(struct exec_package *, char *, const char *);
84 1.22 mrg
85 1.21 ad void compat_sysctl_init(void);
86 1.21 ad void compat_sysctl_fini(void);
87 1.21 ad
88 1.1 christos #endif /* !_COMPAT_UTIL_H_ */
89