• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/15

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

15 Cards in this Set

  • Front
  • Back
What system call can we use to create a new process?
fork()
What is returned by fork()?
Zero for child, pid for parent, or -1 for error.
If fork() returns zero, how do we find the child's pid?
getpid()
If fork() returns zero, how do we find the parent's pid?
getppid()
If fork() returns an integer greater than zero, how do we find the parent's pid?
getpid()
What is returned by getppid() when fork() is a positive integer?
The pid of the PARENT of the parent process.
What function can we use to force output to appear?
fflush(stdout)
What can we use to separate the outputs from a fork() switching mechanism?
sleep()
Will the parent's variables have become available to the child upon fork()?
Yes, but only a copy.
Are the child's copies linked to the parent's variables?
No.
What function can the parent use to find out whether the child has terminated?
wait(&status), satisfied by the child's calling of exit()
What is the use of execve()?
Requests a new program within a process, overwriting the old instructions and data but keeping the pid.
What does execve() return on success?
Nothing.
What does execve() return on error?
-1
After a fork, is execve() normally called from parent or child?
Child.