Quiz APUE7-8 Process1

___ is a type of file used for network communication between processes via network.
Regular file
Directory file
Socket
FIFO
Symbolic link
Signals provide a way of handling ___ events
Synchronous
Asynchronous
Deadlocked
All of the above
None of the above
___ is a technique used to notify a process that some condition has occurred.
Process
Thread
Pipe
Signal
Socket
In Unix/Linux a file ___ is normally small non-negative integer that the kernel uses to identify the files accessed by a process.
Buffer
Information
Descriptor
Cabinet
Lock
When a process calls one of the ____ functions, that process is completely replaced by the new program, and the new program starts executing at its main function. It merely replaces the current process—its text, data, heap, and stack segments—with a brand-new program from disk.
Fork
Exec
Dup or dup2
Pipe
Socket
By convention, all shells in Unix open ___ descriptors whenever a new program is run.
Zero
One
Two
Three
Many
A(n) ___ has only one thread of control—one set of machine instructions executing at a time.
Pipe
Process
Program
Signal
Socket
___ is a type of file that points to another file.
Regular file
Directory file
Socket
FIFO
Symbolic link
After creating a(n) ____, the process typically spawns a new process (for the child inherits open file descriptors).
Fork
Thread
Socket
Pipe
Lock
By convention, UNIX System shells associate file descriptor __ with the standard input of a process.
0 (zero)
1 (one)
2 (two)
3 (three)
None of the above
The new file descriptor returned by dup is guaranteed to be the ___ numbered available file descriptor.
Lowest-
Highest-
Fixed-
Arbitrary-
Stack-
Historically, a C program has been composed of the following pieces: Text segment, Initialized data segment, Uninitialized data segment, stack, and heap. Among them, ___ is consisting of the machine instructions (program) that the CPU executes.
Text segment
Initialized data segment
Uninitialized data segment
Stack
Heap
___ is a lightweight process
Child process
Process
Thread
Socket
Handler
After fork, the return value in the child is ___.
0
1
-1
Process id of the parent
Process id of the child
This signal is generated by the terminal driver when we press the interrupt key (often DELETE or Control-C).
SIGINT
SIGJVM1
SIGTSTP
SIGUSER1
SIGCNTLC
After fork, the differences between the parent and child are:
The return values from fork
The process IDs
The different parent process IDs
All of the above
None of the above
A ____ is an executable file residing on disk in a directory
Process
Thread
Pipe
Socket
Program
___ allocates space for a specified number of objects of a specified size. The space is initialized to all 0 bits.
Alloc
Malloc
Calloc
Noalloc
Free
___ is a unit of work
Process
Thread
Monitor
Transaction
Signal
With dup2(int fd, int fd2), specify the value of the new descriptor with the __ argument. If __ is already open, it is first closed.
Fd
Fd2
Dup
Process
Fork
Historically, a C program has been composed of the following pieces: Text segment, Initialized data segment, Uninitialized data segment, stack, and heap. Among them, ____ is where dynamic memory allocation usually takes place.
Text segment
Initialized data segment
Uninitialized data segment
Stack
Heap
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.
Disk
Partition
Cylinder
File block
I-node
The new process created by fork is called the child process. This function is called once but returns ___.
None
Once
Twice
Three times
None of the above
___ is an executing instance of a program.
Process
Thread
Pipe
Signal
Socket
___ will make a copy of the current process.
Dup
Fork
Pipe
Spawn
Thread
Historically, a C program has been composed of the following pieces: Text segment, Initialized data segment, Uninitialized data segment, stack, and heap. Among them, ___ is where automatic variables are stored, along with information that is saved each time a function is called (for example, the address of where to return to and certain information about the caller’s environment, such as some of the machine registers).
Text segment
Initialized data segment
Uninitialized data segment
Stack
Heap
The process can do ___, for dealing with the signal.
Ignore the signal.
Let the default action occur.
Provide a function that is called when the signal occurs.
All of the above
None of the above
All ___ within a process share the same address space, file descriptors, stacks, and process-related attributes.
Processes
Threads
Pipes
Sockets
Semaphores
___ is the most common type of file, which contains data of some form. There is no distinction to the UNIX kernel whether this data is text or binary.
Regular file
Directory file
Block special file
FIFO
Symbolic link
___ allocates a specified number of bytes of memory. The initial value of the memory is indeterminate.
Alloc
Malloc
Calloc
Noalloc
Free
 
What would be a proper way to set a signal handler (sig_int) for SIGINT?
Signal(SIGINT, sig_int);
Signal(sig_int, SIGINT);
Sig_int(SIGINT);
SIGINT(sig_int);
SIGINT(signal, sig_int);
For a convenience, ___ call is used to execute a command string from within a program.
Dup
Pipe
Socket
Thread
System
A disk drive is divided into one or more ____(s) where each ___ can contain a file system
Disk
Partition
Cylinder
Directory
I-node
{"name":"Quiz APUE7-8 Process1", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"___ is a type of file used for network communication between processes via network., Signals provide a way of handling ___ events, ___ is a technique used to notify a process that some condition has occurred.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker