… | |
… | |
30 | Linux::Clone::NEWPID |
30 | Linux::Clone::NEWPID |
31 | Linux::Clone::NEWUTS |
31 | Linux::Clone::NEWUTS |
32 | Linux::Clone::NEWIPC |
32 | Linux::Clone::NEWIPC |
33 | Linux::Clone::NEWNET |
33 | Linux::Clone::NEWNET |
34 | Linux::Clone::NEWCGROUP |
34 | Linux::Clone::NEWCGROUP |
|
|
35 | Linux::Clone::NEWTIME |
35 | |
36 | |
36 | Example: unshare the network namespace and prove that by calling ifconfig, |
37 | Example: unshare the network namespace and prove that by calling ifconfig, |
37 | showing only the unconfigured lo interface. |
38 | showing only the unconfigured lo interface. |
38 | |
39 | |
39 | Linux::Clone::unshare Linux::Clone::NEWNET |
40 | Linux::Clone::unshare Linux::Clone::NEWNET |
… | |
… | |
160 | |
161 | |
161 | The following C<$type> constants are available if the kcmp syscall number |
162 | The following C<$type> constants are available if the kcmp syscall number |
162 | was available during compilation: |
163 | was available during compilation: |
163 | |
164 | |
164 | C<Linux::Clone::KCMP_FILE>, C<Linux::Clone::KCMP_VM>, C<Linux::Clone::KCMP_FILES>, |
165 | C<Linux::Clone::KCMP_FILE>, C<Linux::Clone::KCMP_VM>, C<Linux::Clone::KCMP_FILES>, |
165 | C<Linux::Clone::KCMP_FS>, C<Linux::Clone::KCMP_SIGHAND>, C<Linux::Clone::KCMP_IO> and |
166 | C<Linux::Clone::KCMP_FS>, C<Linux::Clone::KCMP_SIGHAND>, C<Linux::Clone::KCMP_IO>, |
166 | C<Linux::Clone::KCMP_SYSVSEM>. |
167 | C<Linux::Clone::KCMP_SYSVSEM> and C<Linux::Clone::KCMP_EPOLL_TFD>. |
167 | |
168 | |
168 | =item Linux::Clone::configure_loopback |
169 | =item Linux::Clone::configure_loopback |
169 | |
170 | |
170 | Configures a working loopback interface (basically, does the equivalent of |
171 | Configures a working loopback interface (basically, does the equivalent of |
171 | "ifconfig lo up" which automatically adds ipv4/ipv6 addresses and routes), |
172 | "ifconfig lo up" which automatically adds ipv4/ipv6 addresses and routes), |
172 | which can be useful to get a network namespace going. |
173 | which can be useful to get a network namespace going. |
173 | |
174 | |
174 | Dies on error and returns nothing. |
175 | Dies on error and returns nothing. |
|
|
176 | |
|
|
177 | =item C<ioctl> symbols |
|
|
178 | |
|
|
179 | The following ioctl symbols are also provided by this module (see L<ioctl_ns(8)>). |
|
|
180 | |
|
|
181 | Linux::Clone::NS_GET_USERNS |
|
|
182 | Linux::Clone::NS_GET_PARENT |
|
|
183 | Linux::Clone::NS_GET_NSTYPE |
|
|
184 | Linux::Clone::NS_OWNER_UID |
175 | |
185 | |
176 | =back |
186 | =back |
177 | |
187 | |
178 | =cut |
188 | =cut |
179 | |
189 | |
… | |
… | |
193 | and die "Linux::Clone::configure_looopback: unable to bring up loopback interface: $!\n"; |
203 | and die "Linux::Clone::configure_looopback: unable to bring up loopback interface: $!\n"; |
194 | } |
204 | } |
195 | |
205 | |
196 | 1; |
206 | 1; |
197 | |
207 | |
|
|
208 | =head1 SEE ALSO |
|
|
209 | |
|
|
210 | L<IO::AIO> has some related functions, such as C<pidfd_send_signal>, and |
|
|
211 | some unrelated fucntions that might be useful. |
|
|
212 | |
|
|
213 | L<cgroup_namespaces(7)>, L<pid_namespaces(7)>, L<user_namespaces(7)>, L<time_namespaces(7)>, |
|
|
214 | L<ip-netns(8)>, L<lsns(8)>, L<switch_root(8)>, L<ioctl_ns(2)>. |
|
|
215 | |
198 | =head1 AUTHOR |
216 | =head1 AUTHOR |
199 | |
217 | |
200 | Marc Lehmann <schmorp@schmorp.de> |
218 | Marc Lehmann <schmorp@schmorp.de> |
201 | http://home.schmorp.de/ |
219 | http://home.schmorp.de/ |
202 | |
220 | |