Quiz
CS3560 Final
Dieses Quiz enthält Fragetypen, die sich im gewohnten Player öffnen.
Fragen in diesem Quiz (75)
1Programs that see no difference between disk files and devices are called [blank_start]tool[blank_end]
- Atool
2Buffering and editing comprise [blank_start]canonical[blank_end] processing.
- Acanonical
3Noncanonical mode uses buffering.
- ARichtig
- BFalsch
4When all processing is turned off, the terminal driver passes input directly to the program. In this case, the driver is said to be in
- Acanonical mode
- Bnoncannical mode
- Ccrmode
- Draw mode
5When a system call waits for input, the program is said to be
- Ablocked
- Btackled
- Cfrozen
- Dinterrupted
6When interrupting a program by pressing Ctrl-C, the kernel uses a mechanism called a
- Astop
- Bsignal
- Cfault
- Dpause
7Requests for signals come from
- Ausers
- Bkernel
- Cprocesses
- Dall of the above
8The [blank_start]signal[blank_end] call installs a new signal handler for the specified signal.
- Asignal
9A program can wait for a child process to terminate by calling sleep.
- ARichtig
- BFalsch
10A Unix shell runs programs by calling
- Afork
- Bexec
- Cwait
- Dall of the above
11The new process created by fork is called the
- Achild process
- Bderived process
- Cparent process
- Dprocess
12wait returns the PID of the finishing process.
- ARichtig
- BFalsch
13When execvp loads a program from the disk, the kernel loads the new program into the current process, replacing the code and data of that process.
- ARichtig
- BFalsch
14The shell code command
who | sort > prev- ANone of these
- Bevaluates to true if who | sort is greater than prev
- Cpasses the output of who to sort, which then sends the sorted output to a file named prev.
- Dcontains the bitwise or operator, and performs a bitwise operation on the result of sort > prev
15All Unix tools use the following descriptor:
- AAll of these
- B0
- C1
- D2
16Programs redirect I/O
- ARichtig
- BFalsch
17When you open a file, you always get the lowest available file descriptor.
- ARichtig
- BFalsch
18The dup system call
- Acopies c-strings.
- Bcopies a file descriptor
- Cduplicates a terminal session
- Dmakes a copy of a file
19A pipe is a two-way data channel inside the kernel.
- ARichtig
- BFalsch
20The pipe system call is used to create a pipe.
- ARichtig
- BFalsch
21Pipes are just files used for sharing data between processes.
- ARichtig
- BFalsch
22A named pipe connects related processes and exists independently of processes.
- ARichtig
- BFalsch
23Shared memory segments live in memory independent of processes.
- ARichtig
- BFalsch
24A semaphore is a process variable accessible to all processes on a system.
- ARichtig
- BFalsch
25This system call is used to lock an open file:
- Afcntl
- Ball of these
- Cflock
- Dlockf
26To create a named pipe ( FIFO ), use the system call
- Acreat
- Bmkfifo
- Cmkpipe
- Dpipe
27Shared memory segments...
- Aall of these
- Bhave keys
- Clive in memory independent of a process
- Dhave an owner and permission bits
28To remove a FIFO,
- Ause the fcntl system call
- Buse unlink system call
- Cclose the processes using it
- Duse the close system call
29A process calls ________ to replicate itself.
- Adup
- Bpipe
- Cfork
- Dexecvp
30After a fork system call, the child process begins execution
- Anone of these
- Bat the beginning of main
- Cafter receiving the SIGRESUME signal
- Dat the return from fork
31Processes have
- Apriority
- Bniceness level
- Call of these
- Da size
32Keyboard signals go to
- Aall attached processes
- Bthe child process
- Ca zombie process
- Dthe parent process
33The new process created by fork is called the
- Aderived process
- Bparent process
- Cchild process
- Dbase process
34To block a parent process until the child process terminates, use which system call:
- Ablock
- Bwait
- Cpause
- Dexit
35The following system call creates a process.
- Asplit
- Bexec
- Cfork
- Drun
36The following system command is used to change or retrieve the settings of the terminal driver
- Astty
- Bttsy
- Cterm
- Dcat
37Signals caused by events outside the process are called
- Asynchronous signals
- Basynchronous signals
38Processes can decide what to do with a signal by using this system call
- Asigint
- Bsignal
- Csigkill
- Dflag
39Which of the following is used to redirect output to a file?
- A|
- B>
- C<
- D&
40What can a process do about a signal?
- Aaccept the default action
- Bignore the signal
- Ccall a function
- Dall of the above
41Standard error has which file descriptor
- A2
- B0
- C1
- D3
42To install a signal handler, a program can use this system call
- Asignal
- Bhandle
- Cfopen
- Dscntl
43Briefly explain the term atomic operation. What is it? When or why is such an operation useful?
- AAn atomic operation is an operation that either happens entirely or not at all. It is useful to avoid race conditions so that we don't overwrite data or read bad data.
- BAn operation that can not be further subdivided.
- CAll the above
44A signal is a one-word message.
- ARichtig
- BFalsch
45Non-canonical mode provides buffering to the terminal device connection.
- ARichtig
- BFalsch
46All shells will reset the terminal driver once a program exits.
- ARichtig
- BFalsch
47The structure used to hold the attributes of a terminal device is
- Astruct attribs
- Bstruct termios
- Cstruct device
- Dstruct term
48Every device will support the ________ system call.
- Atcgetattr
- Biofcntl
- Cioctl
- Dfcntl
49Kernel subroutines that received data from and send data to a device are called
- Adrivers
- Bbuffers
- Cfiles
- Dfunctions
50Devices in a Unix system support which of the following system calls:
- Aclose
- Bstat
- Copen
- Dall of these
51Which of the following expressions could be used to clear a bit in a terminal settings flag?
- Aif( flagset & MASK )
- BNone of these
- Cif( flagset &= ~MASK )
- Dif( flagset |= MASK )
52The following library function is used to transfer settings to struct termios:
- Asttygetattr
- Btcgetattr
- Ctcgetattribs
- Dtcattr
53The option for tcsetattr to update settings immediately is
- ATCSAFLUSH
- Bnone of these
- CTCSANOW
- DTCSADRAIN
54Write a simple program that continuously prints "hello, world!" to the screen until it receives the interrupt signal. Upon receiving the signal, the program should print "goodbye, world!" then terminate. Write the program by filling in the blanks in the following code:
#include "stdio.h" #include "stdlib.h" #include "signal.h"
void handler( [blank_start]____1____[blank_end] )
{
printf("goodbye, world!⧵n");
[blank_start]____2____[blank_end](1); }
int main( int ac, char* argc[] )
{
[blank_start]____3____[blank_end]( [blank_start]____4____[blank_end], [blank_start]____5____[blank_end]);
while( 1 )
printf("Hello, world!⧵n");
return 0;
}- Aint i
- Bexit
- Csignal
- DSIGINT
- Ehandler
55A process can play a sound by writing bytes to a file.
- ARichtig
- BFalsch
56To Unix, disk files are a different kind of object from sound cards.
- ARichtig
- BFalsch
57The terminal driver is separate from the kernel.
- ARichtig
- BFalsch
58In the array containing the file descriptors for working with a pipe, the read end file descriptor is
- Areturned by the system call
- Bstored in element 1
- Cis assigned to a global variable
- Dstored in element 0.
59Standard output goes to which file descriptor?
- A1
- B0
- C3
- D2
60In the array containing the file descriptors for working with a pipe, the write end file descriptor is
- Areturned by the system call
- Bis assigned to a global variable
- Cstored in element 1
- Dstored in element 0.
61The POSIX standard guarantees the kernel will not break up chunks of data read from a pipe that are
- A4096 bytes or less
- B1024 bytes or less
- C512 bytes or less
- D512 kilobytes or less
62In order to send data to a pipe, use
- Astrcpy
- Bfout
- Cwrite
- Dread
63When a pipe is created, the process sees _________ file descriptors.
- A2
- B0
- C1
- D3
64All Unix tools use the following descriptor:
- AAll of these
- B0
- C1
- D2
65A pipe is not a file.
- ARichtig
- BFalsch
66When a pipe is created, an array is assigned 3 file descriptors: one for the reading end, one for the writing end, and then one for tracking it within the kernel.
- ARichtig
- BFalsch
67The duplicat system call is used to copy file descriptors.
- ARichtig
- BFalsch
68A named pipe connects related processes and exists independently of processes.
- ARichtig
- BFalsch
69A semaphore is a process variable accessible to all processes on a system.
- ARichtig
- BFalsch
70Shared memory segments live in memory independent of processes.
- ARichtig
- BFalsch
71Briefly describe the method for redirecting I/O for a process so standard input is attached to a file rather than the keyboard.
- ADiscussion begins in chapter 10, around slide #40.Was looking for a description of one of the three main methods: close then open, or open, close, dup, close, or
open, dup2, close. - BSummary on slide #72.
- ADiscussion begins in chapter 10, around slide #40.Was looking for a description of one of the three main methods: close then open, or open, close, dup, close, or
72Briefly describe happens in the kernel when control passes to the kernel after the fork system call.
- ASimilar to creating a disk file.
- BThe kernel finds free memory pages to store the instructions and data of the process. It then sets up data structures to store memory allocation info and attributes of the process.
73The fork system call returns 0 to it's parent process.
- ARichtig
- BFalsch
74The fork system call returns the process id of the child process to the parent process.
- ARichtig
- BFalsch
75Processes have a size.
- ARichtig
- BFalsch
Informationen
- Beschreibung
- Computer Science Quiz am CS3560 Final, erstellt von Harrison Tran am 30/08/2016.
- Autor
- Harrison Tran
- Sprache
- English
- Aufrufe
- 1
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz