Deleted Added
full compact
freebsd32_misc.c (184829) freebsd32_misc.c (185435)
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 184829 2008-11-10 23:36:20Z peter $");
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 185435 2008-11-29 14:32:14Z bz $");
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/clock.h>
35#include <sys/exec.h>
36#include <sys/fcntl.h>
37#include <sys/filedesc.h>
38#include <sys/imgact.h>
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/clock.h>
35#include <sys/exec.h>
36#include <sys/fcntl.h>
37#include <sys/filedesc.h>
38#include <sys/imgact.h>
39#include <sys/jail.h>
39#include <sys/kernel.h>
40#include <sys/limits.h>
41#include <sys/lock.h>
42#include <sys/malloc.h>
43#include <sys/file.h> /* Must come after sys/malloc.h */
44#include <sys/mbuf.h>
45#include <sys/mman.h>
46#include <sys/module.h>

--- 1984 unchanged lines hidden (view full) ---

2031 if (uap->oldlenp)
2032 suword32(uap->oldlenp, j);
2033done2:
2034 mtx_unlock(&Giant);
2035 return (error);
2036}
2037
2038int
40#include <sys/kernel.h>
41#include <sys/limits.h>
42#include <sys/lock.h>
43#include <sys/malloc.h>
44#include <sys/file.h> /* Must come after sys/malloc.h */
45#include <sys/mbuf.h>
46#include <sys/mman.h>
47#include <sys/module.h>

--- 1984 unchanged lines hidden (view full) ---

2032 if (uap->oldlenp)
2033 suword32(uap->oldlenp, j);
2034done2:
2035 mtx_unlock(&Giant);
2036 return (error);
2037}
2038
2039int
2040freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap)
2041{
2042 uint32_t version;
2043 int error;
2044 struct jail j;
2045
2046 error = copyin(uap->jail, &version, sizeof(uint32_t));
2047 if (error)
2048 return (error);
2049 switch (version) {
2050 case 0:
2051 {
2052 /* FreeBSD single IPv4 jails. */
2053 struct jail32_v0 j32_v0;
2054
2055 bzero(&j, sizeof(struct jail));
2056 error = copyin(uap->jail, &j32_v0, sizeof(struct jail32_v0));
2057 if (error)
2058 return (error);
2059 CP(j32_v0, j, version);
2060 PTRIN_CP(j32_v0, j, path);
2061 PTRIN_CP(j32_v0, j, hostname);
2062 j.ip4s = j32_v0.ip_number;
2063 break;
2064 }
2065
2066 case 1:
2067 /*
2068 * Version 1 was used by multi-IPv4 jail implementations
2069 * that never made it into the official kernel.
2070 */
2071 return (EINVAL);
2072
2073 case 2: /* JAIL_API_VERSION */
2074 {
2075 /* FreeBSD multi-IPv4/IPv6,noIP jails. */
2076 struct jail32 j32;
2077
2078 error = copyin(uap->jail, &j32, sizeof(struct jail32));
2079 if (error)
2080 return (error);
2081 CP(j32, j, version);
2082 PTRIN_CP(j32, j, path);
2083 PTRIN_CP(j32, j, hostname);
2084 PTRIN_CP(j32, j, jailname);
2085 CP(j32, j, ip4s);
2086 CP(j32, j, ip6s);
2087 PTRIN_CP(j32, j, ip4);
2088 PTRIN_CP(j32, j, ip6);
2089 break;
2090 }
2091
2092 default:
2093 /* Sci-Fi jails are not supported, sorry. */
2094 return (EINVAL);
2095 }
2096 return (kern_jail(td, &j));
2097}
2098
2099int
2039freebsd32_sigaction(struct thread *td, struct freebsd32_sigaction_args *uap)
2040{
2041 struct sigaction32 s32;
2042 struct sigaction sa, osa, *sap;
2043 int error;
2044
2045 if (uap->act) {
2046 error = copyin(uap->act, &s32, sizeof(s32));

--- 678 unchanged lines hidden ---
2100freebsd32_sigaction(struct thread *td, struct freebsd32_sigaction_args *uap)
2101{
2102 struct sigaction32 s32;
2103 struct sigaction sa, osa, *sap;
2104 int error;
2105
2106 if (uap->act) {
2107 error = copyin(uap->act, &s32, sizeof(s32));

--- 678 unchanged lines hidden ---