CPU-api Flashcards
Why is exec useful?
If you want to run a program that is different from the calling programing.
What does exec() do?
It loads code (and static data) from that executable and overwrites its current code segment (and current static data) with it; the heap and stack and other parts of the memory space of the program are re-initialized. A successful call to exec() never returns.
Explain what the shell is
It is a user program. It shows you a prompt and then waits for you to type something in
Explain what the shell is
It is a user program. It shows you a prompt and then waits for you to type something into it. Can execute files by typing a command into it, then shell figures out where in the file system the executable resides. Calls fork(), calls exec(), then waits(), When child completes the shell returns from wait and prints out a prompt.
What does wc p3.c > newfile.txt do?
Output of the program wc is redirected into the output fil newfile.txt. Shell closes the stdoutput before calling exec and opens file newfile.txt.
Name an example of a shell
Bash
What does kill() sustem call do?
It send signals to a process, including directives to go to sleep, die, and other useful imperatives.
What does top, MenuMeters show?
See how much CPU is being utilized at any moment in time.