Process-associated files
Each process-associated file resides in a directory of the form /proc/pid,
where pid is the PID of the process in the PID namespace that is associated with
the PROC mount. The
ctime of that directory is the start time of the process, and
can be used to determine whether a PID was reused.- /proc/pid/comm
- This file contains the last executed command in the process.
- /proc/pid/cwd
- This file is a magic symbolic link to the current working directory of the process.
- /proc/pid/cmdline
- This file contains the command-line arguments as seen by the process that is being executed. The contents may include binary data and null characters (NULs) if such characters were provided on exec.
- /proc/pid/exe
- This file is a magic symbolic link to the last executable that was executed in the process. The file may be empty if the process corresponds to an MVS program.
- /proc/pid/fd/
- Each file in this directory is a magic symbolic link and corresponds to an open file descriptor
in the process. The link points to the file that was opened, and reading the link will produce a
path to the open file. If the file was deleted, or is in some way inaccessible, reading the link
will also have the text "(deleted)" after the path to the
file.Note: Opening these symbolic links directly opens the files without performing any access checks other than the specific file that is associated with the file descriptor, like with the /dev/fd/xxx character special files.
- /proc/pid/mountinfo
- This file contains a list of the mounts and detailed mount information in the process’s mount
namespace that are accessible from the process’s root directory. If a mount is added or removed
while the file is being read, there is no guarantee that all mounts will be shown. The following is
an example
line:
6 5 0:6 / /my/mount rw,nosuid unbindable - TFS MYMOUNT rw,-s 10The whitespace-delimited items are, in order:- The device number of the mount.
- The device number of the mount’s parent.
- The prefix “0:” followed by the device number of the real file system for the mount. In most cases, this is identical to the first field but may be different in the case of a bind mount.
- The path to root vnode with respect to the root of the real file system. For normal mounts this will be “/” but can be different in the case of a bind mount.
- The mount point, with respect to the root of the process.
- LFS-related mount options.
- Additional LFS-related mount options. Currently “unbindable” is the only option here which might be present. This list is terminated by the dash (“-”).
- The file system type.
- The file system name.
- The file system parameters.
- /proc/pid/mounts
- This file contains a list of mounts in the process’s mount namespace that are accessible from
the process’s root directory. If a mount is added or removed while the file is being read, there is
no guarantee that all mounts will be shown. The following is an example
line:
The white space-delimited items are, in order:MYMOUNT /my/mount TFS rw,nosuid,-s 10 0 0- The file system name.
- The mount point.
- The file system type.
- The LFS-related mount options and mount parameters of the file system.
- Two 0’s, present for compatibility.
- /proc/pid/mountstats
- This file contains a more human-readable list of mounts in the process’s mount namespace that
are accessible from the process’s root directory. If a mount is added or removed while the file is
being read, there is no guarantee that all mounts will be shown. All lines have the following
format:
Where filesysname is the name of the file system, mountpoint is the mount point of the file system, and filesystype is the file system type.device filesysname mounted on mountpoint with fstype filesystype - /proc/pid/ns/
- A directory containing magic symbolic links pointing to files that represent the namespaces the process belongs to. While these files can be opened, their intent is to be passed to namespace-related syscalls to manage the changing of namespaces.
- /proc/pid/root
- This file is a magic symbolic link to the process’s root directory.
- /proc/pid/stat
- A file containing various process-related statistics. The white space-delimited values represent
the following, in order:
- The PID of the process in the namespace associated with the PROC mount.
- The name of the executable, in parentheses.
- The status of the process:
- R – Running
- S – Sleeping
- T – Stopped
- Z – Zombie
- X – Dead/Terminating
- The PID of the parent process.
- The process group.
- The session ID.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- User usage time, in milliseconds.
- System usage time, in milliseconds.
- Cumulative child user usage time, in milliseconds.
- Cumulative child system usage time, in milliseconds.
- Nice value.
- Process priority.
- The number of process threads.
- 0 – Reserved for compatibility.
- Process start time, in seconds since epoch.
- Virtual storage size, in bytes.
- Real storage size, in bytes.
- Real storage limit, in bytes.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- 0 – Reserved for compatibility.
- Exit code, if the process has exited.
- /proc/pid/status
- This file contains process-related statistics with line containing a white-space delimited field
name and value. Each field is described in the following table:
Name Description Name The executable name. Umask The umask for the process. State The process’s running state. Pid The PID of the process in the PID namespace associated with the mount. PPid The PID of the parent process. Uid The real, effective, saved, and effective (for compatibility) UIDs for the process. Gid The real, effective, saved, and effective (for compatibility) GIDs for the process. FDsize The maximum number of file descriptors the process can open. NSpid The PIDs for each of the PID namespace that the process is in, in order from the PID namespace associated with the mount down to the namespace of the process. NSpgid The process group ID for each of the PID namespaces the process is in, in order from the PID namespace associated with the mount down to the namespace of the process. Threads The number of threads in the process. SigPnd The signals pending in the initial process thread. ShdPnd The signals pending among all threads in the process. SigBlk The current blocked signals mask. SigIgn Ignored signals - (not by default). SigCgt Signals currently caught. NoNewPrivs 1 if NoNewPrivs is enabled, 0 otherwise. VmSize The virtual storage size. Each of the signal values is hexadecimal values and are written with the rightmost bit representing bit 0, for compatibility reasons.
