Process Programming Flashcards
ps vs ps aux
ps returns processes of current terminal while ps aux returns all processes of the user
kill -9 pid
SIGKIL to process with pid. SIGKILL can not be handle. Its like “force kill”
Το παιδι κληρονομει τις μεταβλητες του πατερα του;
Ναι
What is orphan process?
A process whose parent has terminated or exited
What is zombie process?
A process that has terminated remains in the system until its parent receives its exit code. This whole time the process is a zombie.
In the exec family whats the use of “l” and whats the use of “v”
“l” is used when the arguments to the new process are fixed and is called like:
execl(path, arg1,arg2,arg3)
“v” is used then the arguments are variable and they are passed as a list like:
execv(path, args[])
In the exec family whats the use of “e”
With “e” we can define an environment for the child process (environment variables). For example:
execle(parth,arg1,arg2,env)
env should be a mapping (dictionary) with key:value pairs –> env_var:value
In the exec family whats the use of “p”
When “p” is used, the PATH env var is used to locate the file to be executed. If “p” is not used then an absolute or relative path must be provided for example:
execlp(filename, arg1, arg2)
execl(absolute or relative path, arg1,arg2)
Κληρονομουνται οι file descriptors?
Ναι
In a pipe which is the read and which the write end?
p[0] is read
p[1] is write