Skip to content
Snippets Groups Projects
Commit 03799468 authored by Joey Le's avatar Joey Le
Browse files

Complted questions

parent 5833cd0a
No related branches found
No related tags found
No related merge requests found
1. Can you think of why we use `fork/execvp` instead of just calling `execvp` directly? What value do you think the `fork` provides?
> **Answer**: _start here_
> **Answer**: fork allows them to run at the saem time so the parent process doesn't stop
2. What happens if the fork() system call fails? How does your implementation handle this scenario?
> **Answer**: _start here_
> **Answer**: if fork fails then we just ask for new input and it just stops the child input and nothing really happens.
3. How does execvp() find the command to execute? What system environment variable plays a role in this process?
> **Answer**: _start here_
> **Answer**: it finds them in the PATH environment variable.
4. What is the purpose of calling wait() in the parent process after forking? What would happen if we didn’t call it?
> **Answer**: _start here_
> **Answer**: Wait allows the child process to complment so that the process wouldn't turn into a zombie
5. In the referenced demo code we used WEXITSTATUS(). What information does this provide, and why is it important?
> **Answer**: _start here_
> **Answer**: It gets the exit status of the child
6. Describe how your implementation of build_cmd_buff() handles quoted arguments. Why is this necessary?
> **Answer**: _start here_
> **Answer**: It treats them as a whole argument and doesn't ignore the space. So that the whole quote goes in at the same time in one arg
7. What changes did you make to your parsing logic compared to the previous assignment? Were there any unexpected challenges in refactoring your old code?
> **Answer**: _start here_
> **Answer**: Yeah, there was a whole lot to change from the ground up, but I think it's easier to read and more straightforward now
8. For this quesiton, you need to do some research on Linux signals. You can use [this google search](https://www.google.com/search?q=Linux+signals+overview+site%3Aman7.org+OR+site%3Alinux.die.net+OR+site%3Atldp.org&oq=Linux+signals+overview+site%3Aman7.org+OR+site%3Alinux.die.net+OR+site%3Atldp.org&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBBzc2MGowajeoAgCwAgA&sourceid=chrome&ie=UTF-8) to get started.
- What is the purpose of signals in a Linux system, and how do they differ from other forms of interprocess communication (IPC)?
> **Answer**: _start here_
> **Answer**: They allow for more processes to run efficently, and are efficent and can be used a timer and terminate each other
- Find and describe three commonly used signals (e.g., SIGKILL, SIGTERM, SIGINT). What are their typical use cases?
> **Answer**: _start here_
> **Answer**: SigKILL immediate kills it no mercy. SigTerm asks to terminate itself, and SigInt is when the user process Ctrl + C
- What happens when a process receives SIGSTOP? Can it be caught or ignored like SIGINT? Why or why not?
> **Answer**: _start here_
> **Answer**: SigStop pauses it, and I think that it can't tbe ignore and just forces it to pauses
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment