Difference between revisions of "C processes in Linux"
From Teknologisk videncenter
m |
m |
||
Line 1: | Line 1: | ||
There are several ways of creating a new process. | There are several ways of creating a new process. | ||
*Most used: | *Most used: | ||
− | **[[fork system call]] family | + | **[[fork system call]] family ("clone" a runnning process to two running instances of the same code) |
− | **[[exec system call]] family | + | **[[exec system call]] family (Execute a file) |
*But also: | *But also: | ||
**[[clone system call]] (Like [[fork system call|fork]] - but more advanced) | **[[clone system call]] (Like [[fork system call|fork]] - but more advanced) |
Latest revision as of 07:59, 17 December 2022
There are several ways of creating a new process.
- Most used:
- fork system call family ("clone" a runnning process to two running instances of the same code)
- exec system call family (Execute a file)
- But also:
- clone system call (Like fork - but more advanced)
- system and popen system call (Can give security issues)
Advanced
prctl
prctl - operations on a process
// Changing the name of running proces
#include <sys/prctl.h>
...
prctl(PR_SET_NAME, "newname");
...