.. ot-topic:: linux.sysprog.process.tree :dependencies: linux.sysprog.process.commandline, linux.basics.intro.process_tree, linux.basics.intro.process, linux.basics.intro.environment .. include:: The Process Tree (And Environment, And ``procfs``) ================================================== .. contents:: :local: Process ID (PID) And Parent Process ID (PPID) --------------------------------------------- .. sidebar:: **See also** * :doc:`/trainings/material/soup/linux/basics/intro/process-tree` * Every process has an ID (PID ... Process ID) * Every process but the first (PID 1) has a parent process) * |longrightarrow| process tree .. image:: /trainings/material/soup/linux/basics/intro/process-tree/process-tree.svg :scale: 40% System Calls: ``getpid()``, ``getppid()`` ----------------------------------------- .. sidebar:: **Documentation** * `man -s 2 getpid `__ * `man -s 2 getppid `__ .. literalinclude:: tree.cpp :language: c++ :caption: :download:`tree.cpp` Environment Variables --------------------- .. sidebar:: **See also** * :doc:`/trainings/material/soup/linux/basics/intro/environment` **Documentation** * `man -s 7 environ `__ * `man -s 3 getenv `__ * `man -s 3 setenv `__ * `man -s 3 putenv `__ * `man -s 3 unsetenv `__ * `man -s 3 clearenv `__ .. literalinclude:: environ.cpp :language: c++ :caption: :download:`environ.cpp`