Start of change

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 10
The whitespace-delimited items are, in order:
  1. The device number of the mount.
  2. The device number of the mount’s parent.
  3. 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.
  4. 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.
  5. The mount point, with respect to the root of the process.
  6. LFS-related mount options.
  7. Additional LFS-related mount options. Currently “unbindable” is the only option here which might be present. This list is terminated by the dash (“-”).
  8. The file system type.
  9. The file system name.
  10. 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:
MYMOUNT /my/mount TFS rw,nosuid,-s 10 0 0
The white space-delimited items are, in order:
  1. The file system name.
  2. The mount point.
  3. The file system type.
  4. The LFS-related mount options and mount parameters of the file system.
  5. 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:
device filesysname mounted on mountpoint with fstype filesystype
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.
/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:
  1. The PID of the process in the namespace associated with the PROC mount.
  2. The name of the executable, in parentheses.
  3. The status of the process:
    • R – Running
    • S – Sleeping
    • T – Stopped
    • Z – Zombie
    • X – Dead/Terminating
  4. The PID of the parent process.
  5. The process group.
  6. The session ID.
  7. 0 – Reserved for compatibility.
  8. 0 – Reserved for compatibility.
  9. 0 – Reserved for compatibility.
  10. 0 – Reserved for compatibility.
  11. 0 – Reserved for compatibility.
  12. 0 – Reserved for compatibility.
  13. 0 – Reserved for compatibility.
  14. User usage time, in milliseconds.
  15. System usage time, in milliseconds.
  16. Cumulative child user usage time, in milliseconds.
  17. Cumulative child system usage time, in milliseconds.
  18. Nice value.
  19. Process priority.
  20. The number of process threads.
  21. 0 – Reserved for compatibility.
  22. Process start time, in seconds since epoch.
  23. Virtual storage size, in bytes.
  24. Real storage size, in bytes.
  25. Real storage limit, in bytes.
  26. 0 – Reserved for compatibility.
  27. 0 – Reserved for compatibility.
  28. 0 – Reserved for compatibility.
  29. 0 – Reserved for compatibility.
  30. 0 – Reserved for compatibility.
  31. 0 – Reserved for compatibility.
  32. 0 – Reserved for compatibility.
  33. 0 – Reserved for compatibility.
  34. 0 – Reserved for compatibility.
  35. 0 – Reserved for compatibility.
  36. 0 – Reserved for compatibility.
  37. 0 – Reserved for compatibility.
  38. 0 – Reserved for compatibility.
  39. 0 – Reserved for compatibility.
  40. 0 – Reserved for compatibility.
  41. 0 – Reserved for compatibility.
  42. 0 – Reserved for compatibility.
  43. 0 – Reserved for compatibility.
  44. 0 – Reserved for compatibility.
  45. 0 – Reserved for compatibility.
  46. 0 – Reserved for compatibility.
  47. 0 – Reserved for compatibility.
  48. 0 – Reserved for compatibility.
  49. 0 – Reserved for compatibility.
  50. 0 – Reserved for compatibility.
  51. 0 – Reserved for compatibility.
  52. 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.

End of change