unix test 2 review Flashcards
The ____ contains all the information about the file: the file type, the file’s access permission bits, the size of the file, pointers to the file’s data blocks, and so on.
i- node
By convention, all shells in Unix open ___ file descriptors whenever a new program is run.
3
A process may do \_\_\_ with the signal ignore the signal let the default action occur provide a function to handle the signal all of the above
All of the above
Including the initial parent process, the total number of the processes (in total) will be ____ after executing the code segment below.
if (pid=fork()) {fork();}
if (pid=fork()) {fork();}
if (pid=fork()) {fork();}
27
A ___ has only one thread of control - one set of machine instructions executing at a time.
process
After fork, the differences between the parent and child are: The return values from fork The process IDs The different parent process IDs Correct All of the above
All of the above
Including the initial parent process, the total number of the processes (in total) will be ____ after executing the code segment below.
if (pid=fork() && pid2 = fork()) {fork();}
if (pid=fork() && pid2 = fork()) {fork();}
if (pid=fork() && pid2 = fork()) {fork();}
64
A file ___ is normally small non-negative integer that the kernel uses to identify the files accessed by a process.
descriptor
Given fork program as shown below, what would be the total number of processes at the end including the process running this program initially.
for (i=1; i
4
By convention, UNIX System shells associate the file descriptor __ with the standard input of a process.
0
This instruction ___ takes two (file descriptor) arguments, to duplicate the first one (file descriptor) to be set for the second one.
dup2
___ will make a copy of the current process.
fork
___ is a type of file that points to another file.
symbolic link
Consider a code segment for a pipe (e.g., to run “ls | wc”) as we discussed in the classes, shown below.
What would it be the code segment using execlp for the “parent” process after setting the file descriptors for the pipe?
execlp(“ls”,”ls”,(char *)0);
The new file descriptor returned by dup is guaranteed to be the ___ numbered available file descriptor
lowest