Architecture Flashcards
What is parameter expansion?
$home = /home/jeroen
what is $IFS
Internal field seperator, IFS=$ā\nā will separate based on new line
What system call does strace use?
ptrace system call
Show strace command
strace -e trace=process <>
What does stat do?
Searches for command in file system
Show stat command
int stat(const char *pathname, struct stat *buf)
What does the shell do to survive before execve
It does a fork
What does fork do
Creates a new process which becomes the child
What is the fork command
pid_t fork(void)
What are better alternatives than regular fork
clone and vfork
Why is fork inefficient?
Lots of copying
Command for vfork?
pid_t vfork(void)
Command for clone?
long clone(unsigned long flags, ..)
Who executes execve and after what?
The child. The parent first issues a fork
Show the execve command
int execve(const char *filename, char *argv[], char envp[]);