Process Programming Flashcards

1
Q

ps vs ps aux

A

ps returns processes of current terminal while ps aux returns all processes of the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

kill -9 pid

A

SIGKIL to process with pid. SIGKILL can not be handle. Its like “force kill”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Το παιδι κληρονομει τις μεταβλητες του πατερα του;

A

Ναι

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is orphan process?

A

A process whose parent has terminated or exited

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is zombie process?

A

A process that has terminated remains in the system until its parent receives its exit code. This whole time the process is a zombie.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In the exec family whats the use of “l” and whats the use of “v”

A

“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[])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In the exec family whats the use of “e”

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In the exec family whats the use of “p”

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Κληρονομουνται οι file descriptors?

A

Ναι

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In a pipe which is the read and which the write end?

A

p[0] is read
p[1] is write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly