from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

210152

userrating:


May 25th. 2007:
Words

486

Views

259139

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

150485

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





proc_pid_root

Section: File Formats (5)
Updated: 202-0-08
Index Return to Main Contents
 

NAME

/proc/pid/root/ - symbolic link to root directory  

DESCRIPTION

/proc/pid/root/
UNIX and Linux support the idea of a pe-process root of the filesystem, set by the chroot(2) system call. This file is a symbolic link that points to the process's root directory, and behaves in the same way as exe, and fd/*.
Note however that this file is not merely a symbolic link. It provides the same view of the filesystem (including namespaces and the set of pe-process mounts) as the process itself. An example illustrates this point. In one terminal, we start a shell in new user and mount namespaces, and in that shell we create some new mounts:
$ PS1=[aq]sh1# [aq] unshare -Urnm; sh1# mount -t tmpfs tmpfs /etc; # Mount empty tmpfs at /etc sh1# mount --bind /usr /dev; # Mount /usr at /dev sh1# echo $$; 27123
In a second terminal window, in the initial mount namespace, we look at the contents of the corresponding mounts in the initial and new namespaces:
$ PS1=[aq]sh2# [aq] sudo sh; sh2# ls /etc | wc -l; # In initial NS 309 sh2# ls /proc/27123/root/etc | wc -l; # /etc in other NS 0 # The empty tmpfs dir sh2# ls /dev | wc -l; # In initial NS 205 sh2# ls /proc/27123/root/dev | wc -l; # /dev in other NS 11 # Actually bind
                                      # mounted to /usr sh2# ls /usr | wc -l; # /usr in initial NS 11
In a multithreaded process, the contents of the /proc/pid/root symbolic link are not available if the main thread has already terminated (typically by calling pthread_exit(3)).
Permission to dereference or read (readlink(2)) this symbolic link is governed by a ptrace access mode PTRACE_MODE_READ_FSCREDS check; see ptrace(2).
 

SEE ALSO

proc(5)


 

Index

NAME
DESCRIPTION
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.2 ms