Deleted Added
full compact
jail.2 (181265) jail.2 (185435)
1.\"
2.\" ----------------------------------------------------------------------------
3.\" "THE BEER-WARE LICENSE" (Revision 42):
4.\" <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5.\" can do whatever you want with this stuff. If we meet some day, and you think
6.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7.\" ----------------------------------------------------------------------------
8.\"
1.\"
2.\" ----------------------------------------------------------------------------
3.\" "THE BEER-WARE LICENSE" (Revision 42):
4.\" <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
5.\" can do whatever you want with this stuff. If we meet some day, and you think
6.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7.\" ----------------------------------------------------------------------------
8.\"
9.\" $FreeBSD: head/lib/libc/sys/jail.2 181265 2008-08-03 21:56:58Z trhodes $
9.\" $FreeBSD: head/lib/libc/sys/jail.2 185435 2008-11-29 14:32:14Z bz $
10.\"
10.\"
11.Dd August 3, 2008
11.Dd November 29, 2008
12.Dt JAIL 2
13.Os
14.Sh NAME
15.Nm jail , jail_attach
16.Nd imprison current process and future descendants
17.Sh LIBRARY
18.Lb libc
19.Sh SYNOPSIS

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

27The
28.Fn jail
29system call sets up a jail and locks the current process in it.
30.Pp
31The argument is a pointer to a structure describing the prison:
32.Bd -literal -offset indent
33struct jail {
34 u_int32_t version;
12.Dt JAIL 2
13.Os
14.Sh NAME
15.Nm jail , jail_attach
16.Nd imprison current process and future descendants
17.Sh LIBRARY
18.Lb libc
19.Sh SYNOPSIS

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

27The
28.Fn jail
29system call sets up a jail and locks the current process in it.
30.Pp
31The argument is a pointer to a structure describing the prison:
32.Bd -literal -offset indent
33struct jail {
34 u_int32_t version;
35 char *path;
36 char *hostname;
37 u_int32_t ip_number;
35 char *path;
36 char *hostname;
37 char *jailname;
38 unsigned int ip4s;
39 unsigned int ip6s;
40 struct in_addr *ip4;
41 struct in6_addr *ip6;
38};
39.Ed
40.Pp
41.Dq Li version
42defines the version of the API in use.
42};
43.Ed
44.Pp
45.Dq Li version
46defines the version of the API in use.
43It should be set to zero at this time.
47.Dv JAIL_API_VERSION
48is defined for the current version.
44.Pp
45The
46.Dq Li path
47pointer should be set to the directory which is to be the root of the
48prison.
49.Pp
50The
51.Dq Li hostname
52pointer can be set to the hostname of the prison.
53This can be changed
54from the inside of the prison.
55.Pp
56The
49.Pp
50The
51.Dq Li path
52pointer should be set to the directory which is to be the root of the
53prison.
54.Pp
55The
56.Dq Li hostname
57pointer can be set to the hostname of the prison.
58This can be changed
59from the inside of the prison.
60.Pp
61The
57.Dq Li ip_number
58can be set to the IP number assigned to the prison.
62.Dq Li jailname
63pointer is an optional name that can be assigned to the jail
64for example for managment purposes.
59.Pp
60The
65.Pp
66The
67.Dq Li ip4s
68and
69.Dq Li ip6s
70give the numbers of IPv4 and IPv6 addresses that will be passed
71via their respective pointers.
72.Pp
73The
74.Dq Li ip4
75and
76.Dq Li ip6
77pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to
78the prison, or NULL if none.
79IPv4 addresses must be in network byte order.
80.Pp
81The
61.Fn jail_attach
62system call attaches the current process to an existing jail,
63identified by
64.Fa jid .
65.Sh RETURN VALUES
66If successful,
67.Fn jail
68returns a non-negative integer, termed the jail identifier (JID).

--- 76 unchanged lines hidden ---
82.Fn jail_attach
83system call attaches the current process to an existing jail,
84identified by
85.Fa jid .
86.Sh RETURN VALUES
87If successful,
88.Fn jail
89returns a non-negative integer, termed the jail identifier (JID).

--- 76 unchanged lines hidden ---