Merge from vendor branch GROFF:
[dragonfly.git] / lib / libc / sys / jail_attach.2
1 .\"
2 .\" Copyright (c) 2005 The DragonFly Project.  All rights reserved.
3 .\" This code is derived from software contributed to The DragonFly Project
4 .\" by Paul Herman.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\"
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\" 3. Neither the name of The DragonFly Project nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific, prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\" $DragonFly: src/lib/libc/sys/jail_attach.2,v 1.2 2005/08/01 01:49:16 swildner Exp $
34 .\"
35 .Dd January 31, 2005
36 .Dt JAIL_ATTACH 2
37 .Os
38 .Sh NAME
39 .Nm jail_attach
40 .Nd attach current process to an existing jail
41 .Sh LIBRARY
42 .Lb libc
43 .Sh SYNOPSIS
44 .In sys/types.h
45 .In sys/jail.h
46 .Ft int
47 .Fn jail_attach "int id"
48 .Sh DESCRIPTION
49 The
50 .Nm
51 system call attaches the current process to an existing jail referenced by
52 .Nm id .
53 .Pp
54 The argument is an int referencing the ID of the prison.
55 .Sh ERRORS
56 .Fn jail_attach
57 will fail if:
58 .Bl -tag -width Er
59 .It Bq Er EPERM
60 The user is not the super user, or is already in a prison.
61 .It Bq Er EINVAL
62 The prison referenced by
63 .Nm id
64 does not exist.
65 .El
66 .Pp
67 .Sh SEE ALSO
68 .Xr jail 2 ,
69 .Xr chroot 2 ,
70 .Xr jail 8 ,
71 .Xr jexec 8 ,
72 .Xr jls 8
73 .Sh HISTORY
74 The
75 .Fn jail_attach
76 function call first appeared in
77 .Fx 5.1
78 and subsequently appeared in
79 .Dx 1.1
80 .Sh AUTHORS
81 The jail_attach man page was written by
82 .An Paul Herman .