Final exam unix

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/109

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

110 Terms

1
New cards

[TCPIP-UNP] Consider client-server model. Which one of the following choices is NOT correct? There are three main classes of servers: synchronous, iterative, and concurrent. Iterative server iterates through each client, handling it one at a time. Concurrent server handles multiple clients at the same time. A concurrent server may spawn a child process with fork to serve a client. A concurrent server with a pool of threads may serve a client with a thread from the pool.

There are three main classes of servers: synchronous, iterative, and concurrent.

2
New cards

[TCPIP-UNP] The ____ utility was written by Mike Muuss in 1983 as a tool to troubleshoot problems in an IP network. It is inspired by David Mills on using ICMP echo packets for IP network diagnosis and measurements. RFC1122 prescribes that any host must process an ICMP Echo Request and issue an Echo Reply in return. ping traceroute netstat ifconfig nslookup

ping

3
New cards

[TCPIP-UNP] Client needs to know Server's IP address and port to be connected. Server's IP address (sin_addr) and port number (sin_port) fields in the Internet socket address structure (sockaddr_in) must be in specific formats. This ____ function converts a binary port number to the proper format (sin_port). host2net htons inet_h2n inet_host2net inetport

htons

4
New cards

[TCPIP-UNP] Client needs to know Server's IP address and port to be connected. Server's IP address (sin_addr) and port number (sin_port) fields in the Internet socket address structure (sockaddr_in) must be in specific formats. This ____ function convert an IP address in ASCII command-line argument (for example, "192.10.16.4") into the proper format (sin_addr). inet_addr32 or str2port inet_port inet_sin or sin_port16 inet_aton or inet_addr sin_addr

inet_aton or inet_addr.

5
New cards

[TCPIP-UNP] Consider TCP socket programming. Which one of the following choices is NOT correct? All three transport layers (UDP, SCTP and TCP) use 32-bit integer port numbers. The well-known and reserved ports: 0 through 1023. Socket pair is the four-tuple that defines the two endpoints of a TCP connection. One end of Socket pair is the local IP address and local port of the host. A socket pair uniquely identifies every TCP connection on a network. A socket consists of two values (an IP address and a port number) that identify each endpoint.

All three transport layers (UDP, SCTP and TCP) use 32-bit integer port numbers.

6
New cards

[TCPIP-UNP] Consider the features or advantages of TCP. TCP provides ______ connection over which TCP client establishes with servers and exchanges data. Which one of the following choices is NOT correct? atomic full-duplexed reliable stateful synchronous

atomic

7
New cards

[TCPIP-UNP] _____ is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. If no arguments are given, it displays the status of the currently active interfaces.

ping

traceroute

netstat

ifconfig

nslookup

ifconfig

8
New cards

Server needs to know client's socket prior to connection being requested.

9
New cards

[TCPIP-UNP] Consider TCP. Which one of the following choices is NOT correct?

TCP is a connection-sensitive protocol

TCP provides a reliable, full-duplex byte stream to its users.

TCP sockets are an example of stream sockets.

TCP takes care of details such as acknowledgments, timeouts, retransmissions, and the like.

TCP provides a flow-control.

TCP is a connection-sensitive protocol

10
New cards

[TCPIP-UNP] Consider TCP socket programming. Which one of the following choices is NOT correct?

All three transport layers (UDP, SCTP and TCP) use 32-bit integer port numbers.

The well-known and reserved ports: 0 through 1023.

Socket pair is the four-tuple that defines the two endpoints of a TCP connection.

One end of Socket pair is the local IP address and local port of the host.

A socket pair uniquely identifies every TCP connection on a network.

A socket consists of two values (an IP address and a port number) that identify each endpoint.

All three transport layers (UDP, SCTP and TCP) use 32-bit integer port numbers.

11
New cards

TCPIP-UNP] Consider IPv4 and IPv6. Which one of the following choices is NOT correct?

IPv4 has been the workhorse protocol of the IP suite since the early 1980s.

IPv4 uses 16-bit addresses.

IPv4 provides packet delivery service for TCP, UDP, SCTP, ICMP, and IGMP.

IPv6 was designed in the mid-1990s as a replacement for IPv4.

IPv6 has a larger address comprising 128 bits.

IPv4 uses 16-bit addresses.

12
New cards

[TCPIP-UNP] Consider client-server model. Which one of the following choices is NOT correct?

There are three main classes of servers: synchronous, iterative, and concurrent.

Iterative server iterates through each client, handling it one at a time.

Concurrent server handles multiple clients at the same time.

A concurrent server may spawn a child process with fork to serve a client.

A concurrent server with a pool of threads may serve a client with a thread from the pool.

There are three main classes of servers: synchronous, iterative, and concurrent.

13
New cards

[APUE11] Which of the following functions is used by a thread to terminate itself?

pthread_detach

pthread_exit

pthread_join

pthread_self

pthread_create

pthread_equal

pthread_terminate

pthread_release

pthread_new

pthread_kill

pthread_exit

14
New cards

[APUE11] What is a thread primitive, corresponding to waitpid for process.

pthread_create

pthread_exit

pthread_join

pthread_cleanup_push

pthread_self

pthread_cancel

pthread_join.

15
New cards

[APUE11] A ___ is basically a lock that a thread does set (lock) before accessing a sharedresource and release(unlock) when we're done.

bit-lock

mutex

conditional variable

semaphore

message queue

mutex

16
New cards

[APUE11] pthread_join function acts as ___ to allow one thread to wait until another thread exits.

lock

mutex

conditional variable

spin lock

barrier

semaphore

barrier

17
New cards

[APUE11] Which of the following items is shared by all thread in a process?

Stack

Program Counter

File descriptors

errno variable

File descriptors

18
New cards

[APUE11] When multiple threads of control share the same memory (a shared variable), one needs to make sure that each thread sees a consistent view of its data. Which of the following statements is not correct? Select one best answer.

If each thread uses variables while other threads don't read or modify, no consistency problems will exist.

If a shared variable is read-only, there is no consistency problem.

When a thread can modify a variable that other threads can read or modify, then inconsistency problem can occur.

While a thread reads a variable, there is no consistency problem.

While a thread reads a variable, there is no consistency problem.

19
New cards

[APUE11] Which of the following functions is used to wait for a thread or threads to terminate?

pthread_detach

pthread_exit

pthread_join

pthread_self

pthread_create

pthread_equal

pthread_terminate

pthread_release

pthread_new

pthread_kill

pthread_join

20
New cards

[APUE11] A thread can arrange for functions to be called when it exits, similar to the way that the atexit function.

pthread_create

pthread_exit

pthread_join

pthread_cleanup_push

pthread_self

pthread_cancel

pthread_cleanup_push

21
New cards

[APUE11] pthread_join function acts as ___ to allow one thread to wait until another thread exits.

lock

mutex

conditional variable

spin lock

barrier

semaphore

barrier

22
New cards

APUE11] Spin locks are useful when used in a(n) ___ kernel: besides providing a mutual exclusion mechanism, they block interrupts so an interrupt handler can't deadlock the system by trying to acquire a spin lock that is already locked.

preemptive

nonpreemptive

reentrant

nonretentrant

concurrent

time-sharing

nonpreemptive

23
New cards

[APUE11] ___ is like a mutex, except that instead of blocking a process by sleeping, the process is blocked by busy-waiting until the lock can be acquired.

simple-lock

busy-mutex

wait-lock

conditional variable

spin-lock

spin-lock

24
New cards

[APUE11.6] We can protect our data and ensure access by only one thread at a time by using the pthreads mutual-exclusion interfaces. A(n) ____ is basically a lock that we set (lock) before accessing a shared resource and release (unlock) when we're done.

barrier

conditional variable

deadlock

livelock

message queue

mutex

pipe

semaphore

mutex

25
New cards

[APUE11.6] A thread will ____ if it tries to lock the same mutex twice.

allocate mutex

deadlock itself

free mutex first

interrupt itself

spin itself

unlock mutex

deadlock itself

26
New cards

[APUE11.6] If we allocate the mutex dynamically (by calling malloc, for example), then we need to call _____ before freeing the memory.

pthread_mutex_destroy

pthread_mutex_deallocate

pthread_mutex_free

pthread_mutex_exit

pthread_mutex_return

pthread_mutex_destroy

27
New cards

[APUE11.6] The condition is the state of the work queue. We protect the condition with a mutex and evaluate the condition in a while loop. When we put a message on the work queue, we need to hold the mutex, but we don't need to hold the mutex when we signal the waiting threads. As long as it is okay for a thread to pull the message off the queue before we call a signal, we can do this after releasing the mutex. Since we check the condition in a while loop, this doesn't present a problem; a thread will wake up, find that the queue is still empty, and go back to waiting again. If the code couldn't tolerate this race, we would need to hold the mutex when we signal the threads. This is about ____ mechanism.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

socket

signal

conditional variable

28
New cards

APUE11.6] _____ objects are more general than this, however. They allow an arbitrary number of threads to wait until all of the threads have completed processing, but the threads don't have to exit. They can continue working after all threads have reached the ____.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

barrier

29
New cards

[APUE11.6] The pthread_join function acts as a ____ to allow one thread to wait until another thread exits.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

barrier

30
New cards

[APUE11.6] ____ is similar to mutex, except that they allow for higher degrees of parallelism. With a mutex, the state is either locked or unlocked, and only one thread can lock it at a time. Three states are possible with this lock: locked in read mode, locked in write mode, and unlocked.

barrier

conditional variable

livelock

message queue

reader-writer lock

semaphore

socket

signal

reader-writer lock

31
New cards

[APUE11.6] When a reader-writer lock is ____ locked, only one thread to ____ can have it while all threads attempting to read must wait until it is unlocked.

allocate

free

access

read

update

write

write

32
New cards

[APUE11.6] ____ is a synchronization mechanism that can be used to coordinate multiple threads working in parallel. It allows each thread to wait until all cooperating threads have reached the same point, and then continue executing from there.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

barrier

33
New cards

[APUE11.6] ____ is useful when used in a nonpreemptive kernel: besides providing a mutual exclusion mechanism, they block interrupts so an interrupt handler can't deadlock the system by trying to acquire a spin lock that is already locked (think of interrupts as another type of preemption). In these types of kernels, interrupt handlers can't sleep, so the only synchronization primitives they can use are ____.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

spinlock

34
New cards

[APUE11.6] With this locking mechanism, there are two functions to notify threads that a condition has been satisfied. The ____ function will wake up at least one thread waiting on a condition, whereas the ____ function will wake up all threads waiting on a condition.

pthread_cond_wakeone, pthread_cond_wakeall

pthread_cond_signal, pthread_cond_signalall

pthread_cond_signal, pthread_cond_broadcast

pthread_cond_signalone, pthread_cond_signalall

pthread_cond_call, pthread_cond_broadcast

pthread_cond_signal, pthread_cond_broadcast

35
New cards

[APUE11.6] When multiple threads of control share the same memory, each thread should see a consistent view of its data.Which one of the following statements is NOT correct?

If each thread uses variables that other threads don't read or modify, there is no consistency problem.

A variable which is read-only could create a consistency problem with more than one thread reading its value at the same time.

When one thread can modify a variable that other threads can read or modify, there is a need to synchronize the threads to ensure that they don't use an invalid value when accessing the variable's memory contents.

When one thread modifies a variable, other threads can potentially see inconsistencies when reading the value of that variable.

On processor architectures in which the modification takes more than one memory cycle, this can happen when the memory read is interleaved between the memory write cycles.

A variable which is read-only could create a consistency problem with more than one thread reading its value at the same time

36
New cards

[APUE11.6] ____ is a synchronization mechanism that can be used to coordinate multiple threads working in parallel. It allows each thread to wait until all cooperating threads have reached the same point, and then continue executing from there.

barrier

37
New cards

[APUE11.6] ____ is often used as low-level primitives to implement other types of locks. Depending on the system architecture, they can be implemented efficiently using test-and-set instructions.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

spinlock

38
New cards

[APUE11.6] Just as with mutexes, the Single UNIX Specification provides functions to lock reader-writer locks with a timeout to give applications a way to avoid blocking indefinitely while trying to acquire a reader-writer lock. One of these functions is _____.

pthread_rwlock_timedrwlock

pthread_rwlock_timelock

pthread_readlock_timed

pthread_rwlock_timedreadlock

pthread_rwlock_timedwrlock

pthread_rwlock_timedwrlock

39
New cards

[APUE11.6] The condition is the state of the work queue. We protect the condition with a mutex and evaluate the condition in a while loop. When we put a message on the work queue, we need to hold the mutex, but we don't need to hold the mutex when we signal the waiting threads. As long as it is okay for a thread to pull the message off the queue before we call a signal, we can do this after releasing the mutex. Since we check the condition in a while loop, this doesn't present a problem; a thread will wake up, find that the queue is still empty, and go back to waiting again. If the code couldn't tolerate this race, we would need to hold the mutex when we signal the threads. This is about ____ mechanism. barrier conditional variable mutex message queue reader-writer lock semaphore socket signal

conditional variable

40
New cards

A single-threaded process with multiple tasks cannot serializes those tasks

41
New cards

[APUE11.6] Only one thread at a time can hold a(n) ____ in write mode, but multiple threads can hold a(n) ____ in read mode at the same time.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

socket

signal

Reader-writer lock

42
New cards

[APUE11.6] ____ is like a mutex, except that instead of blocking a process by sleeping, the process is blocked by busy-waiting until the lock can be acquired. barrier conditional variable lock message queue reader-writer lock semaphore spinlock

spinlock

43
New cards

[APUE11.6] The pthread_join function acts as a ____ to allow one thread to wait until another thread exits.

barrier

conditional variable

mutex

message queue

reader-writer lock

semaphore

spinlock

barrier

44
New cards

[APUE16] Which of the following statements about socket is not correct?

Socket is an abstraction of a communication endpoint.

Applications use socket descriptors to access sockets.

Socket descriptors are implemented as file descriptors in the UNIX System.

Many of the functions with file descriptors (e.g., read or write) will not work with a socket descriptor.

Many of the functions with file descriptors (e.g., read or write) will not work with a socket descriptor.

45
New cards

[APUE16] Which of the following statements about socket programming (accept function) is not correct?

accept provides non-blocking socket.

The file descriptor returned by accept is a socket descriptor that is connected to the client that called connect.

The new socket descriptor by accept has the same socket type and address family as the original socket (sockfd).

The original socket passed to accept is not associated with the connection, but instead remains available to receive additional connect requests.

On return, accept will fill in the client's address in the buffer and update the integer field (len) to reflect the size of the address.

If no connect requests are pending, accept will block until one arrives.

accept provides non-blocking socket.

46
New cards

[APUE16] Which of the following is an application layer protocol (e.g., in TCP/IP model). Ethernet IP Telnet None of the above

Telnet

47
New cards

[APUE16] Which of the following statements about socket programming (out-of-band) is not correct?

Out-of-band data is an optional feature supported by some communication protocols

Out-of-band data allows higher-priority delivery of data than normal.

Out-of-band data is sent ahead of any data that is already queued for transmission.

TCP and UPD support out-of-band data.

TCP refers to out-of-band data as ''urgent'' data.

TCP and UDP support out-of-band data.

48
New cards

[APUE16] Which of the following statements about socket programming (socket descriptor) is not correct?

If the socket descriptor is in blocking mode, the application can use either poll or select to determine when the file descriptor is readable.

If the socket descriptor is in nonblocking mode, the application can use either poll or select to determine when the file descriptor is writable.

The connect function can also be used with a connectionless network service (SOCK_DGRAM).

A connectionless network service provides an optimization even though there may be a compromise in reliability.

A server announces that it is willing to accept connect requests by calling the listen function.

Once a server has called listen, the socket used can receive connect requests with the accept function and convert it into a connection.

If the socket descriptor is in blocking mode, the application can use either poll or select to determine when the file descriptor is readable.

49
New cards

[APUE16] Which of the following statements about socket programming (address byte ordering) is not correct?

If the processor architecture supports big-endian byte order, then the highest byte address occurs in the least significant byte (LSB).

If the processor architecture supports little-endian byte order, then the highest byte address occurs in the most significant byte (MSB).

Regardless of the byte ordering, the most significant byte (MSB) is always on the left, and the least significant byte is always on the right.

For a 32-bit integer with the value 0x04030201, the most significant byte is 0x01, and the least significant byte is 0x04 for little-endian byte order.

The TCP/IP protocol suite uses big-endian byte order.

The byte ordering becomes visible to applications when they exchange formatted data.

For a 32-bit integer with the value 0x04030201, the most significant byte is 0x01, and the least significant byte is 0x04 for little-endian byte order.

50
New cards

[APUE16] Which of the following statements about socket programming (socket descriptor) is not correct?

a socket endpoint is represented as a file descriptor.

one can use read and write to communicate with a socket, as long as it is connected.

using read and write with socket descriptors is significant for one can pass socket descriptors to functions designed to work with local files.

the socket descriptors can be passed to child processes that execute programs that know nothing about sockets.

Although we can exchange data using read and write, that is about all we can do with these two functions.

to receive packets from multiple clients, one must have at least one socket connection per each client.

to receive packets from multiple clients, one must have at least one socket connection per each client.

51
New cards

.[APUE16] Which of the following statements about socket programming with SOCK_STREAM (TCP) is not correct?

a byte stream requires to set up a logical connection between socket

using a connection-oriented protocol for communicating with a peer is like making a phone call.

after the connection in place, one can communicate to the other in one direction.

the connection is a peer-to-peer communication channel over which one communicates.

A SOCK_STREAM socket provides a byte-stream service.after the connection in place, one can communicate to the other in one direction.

After the connection in place, one can communicate to the other in one direction.

52
New cards

[APUE16] Which of the following is common to both TCP and UDP:

Use of connections

Port-to-port communication

Sequenced transmittal of data units

All of the above

Port-to-port communication

53
New cards

[APUE16] ___ allows processes running on different computers (connected to a common network) to communicate with one another.

process

thread

socket

semaphore

socket

54
New cards

Question 1

[APUE16] Which of the following statements about socket programming (nonblocking & asynchronous IO) is not correct?

Normally, the recv functions will block when no data is immediately available.

Normally, the send functions will block when there is not enough room in the socket's output queue to send the message.

The blocking behavior of the send and recv functions can be changed by setting socket option.

When the socket is in nonblocking mode, the send and recv functions will fail instead of blocking

When the socket is in blocking mode, the poll or select functions should be used to send or receive data.

When the socket is in blocking mode, the poll or select functions should be used to send or receive data.

55
New cards

[APUE16] To write code for port-to-port communication (e.g., TCP/IP), a programmer uses:

The datagram library

Frame header structures

The socket application programming interface

Ethernet

The socket application programming interface

56
New cards

[APUE16] Which of the following statements about socket programming (socket descriptor) is not correct?

a socket endpoint is represented as a file descriptor.

one can use read and write to communicate with a socket, as long as it is connected.

using read and write with socket descriptors is significant for one can pass socket descriptors to functions designed to work with local files.

the socket descriptors can be passed to child processes that execute programs that know nothing about sockets.

Although we can exchange data using read and write, that is about all we can do with these two functions.

to receive packets from multiple clients, one must have at least one socket connection per each client.

to receive packets from multiple clients, one must have at least one socket connection per each client.

57
New cards

[APUE16] Which of the following terms is used to denote units of data being transmitted:

Segment

Datagram

Frame

All of the above

All of the above

58
New cards

[APUE16] Which of the following statements about socket programming (close and shutdown) is NOT correct?

The close function deallocates the network endpoint only when all the active references are closed.

If we duplicate the socket (with dup, for example), the socket won't be deallocated until we close the last file descriptor referring to it.

the shutdown function allows an application to deactivate a socket independently of the number of active file descriptors referencing it.

the shutdown function is possible to shut a socket down in one direction only.

an application can shut a socket down for writing while still allowing to receive data sent by the process

The close function deallocates the network endpoint only when all the active references are closed.

59
New cards

[APUE16] Which is not a classical method of IPC provided by various UNIX systems.

pipe

message queue

thread

semaphore

thread

60
New cards

APUE16] Which of the following is part of the syntax of a protocol (e.g., TCP/IP):

Its packet format

Its set of error codes

Its functional purpose

Its timing mechanisms

Its packet format

61
New cards

[APUE16] Which of the following statements about socket programming with datagram is not correct?

Datagram provides a connection-oriented service.

each datagram is a self-contained message.

Sending a datagram is analogous to mailing someone a letter as one can mail many letters, but no guarantee for the order of delivery.

Sending a datagram is analogous to mailing someone a letter as some mails might get lost along the way and not be recovered.

Sending a datagram is analogous to mailing someone a letter as each letter contains the address of the recipient, making the letter independent from all the others.

Datagram provides a connection-oriented service.

62
New cards

[APUE16] The single most important motive for the new IPv6 protocol is:

Address space expansion

Performance improvement

Protocol extensibility

Header simplification

Address space expansion

63
New cards

[APUE16] Which of the following statements about socket programming with SOCK_STREAM (TCP) is not correct?

a byte stream requires to set up a logical connection between socket

using a connection-oriented protocol for communicating with a peer is like making a phone call.

after the connection in place, one can communicate to the other in one direction.

the connection is a peer-to-peer communication channel over which one communicates.

A SOCK_STREAM socket provides a byte-stream service.

After the connection in place, one can communicate to the other in one direction

64
New cards

[APUE16] Which of the following is common to both TCP and UDP:

Use of connections

Port-to-port communication

Sequenced transmittal of data units

All of the above

Port-to-port communication

65
New cards

[APUE16] Which of the following statements about socket programming (accept function) is not correct?

accept provides non-blocking socket.

The file descriptor returned by accept is a socket descriptor that is connected to the client that called connect.

The new socket descriptor by accept has the same socket type and address family as the original socket (sockfd).

The original socket passed to accept is not associated with the connection, but instead remains available to receive additional connect requests.

On return, accept will fill in the client's address in the buffer and update the integer field (len) to reflect the size of the address.

If no connect requests are pending, accept will block until one arrives.

accept provides non-blocking socket.

66
New cards

[APUE16] Which of the following statements about socket programming (socket descriptor) is not correct?

a socket endpoint is represented as a file descriptor.

one can use read and write to communicate with a socket, as long as it is connected.

using read and write with socket descriptors is significant for one can pass socket descriptors to functions designed to work with local files.

the socket descriptors can be passed to child processes that execute programs that know nothing about sockets.

Although we can exchange data using read and write, that is about all we can do with these two functions.

to receive packets from multiple clients, one must have at least one socket connection per each client.


to receive packets from multiple clients, one must have at least one socket connection per each client.

67
New cards

[APUE16] ___ allows processes running on different computers (connected to a common network) to communicate with one another.

process

thread

socket

semaphore

socket

68
New cards

[APUE16] Which of the following statements about socket programming is not correct?

For socket descriptor, one gets a file descriptor that can be used for I/O.

For socket descriptor, using the file descriptor, you call close to relinquish access to the file or socket and free up the file descriptor for reuse.

A socket descriptor is actually a file descriptor

A socket descriptor can be used with every function that accepts a file descriptor argument.

A socket descriptor can be used with every function that accepts a file descriptor argument.

69
New cards

[APUE16] Which of the following terms is used to denote units of data being transmitted:

Segment

Datagram

Frame

All of the above

All of the above

70
New cards

[APUE16] Which of the following statements about socket programming with datagram is not correct?

Datagram provides a connection-oriented service.

each datagram is a self-contained message.

Sending a datagram is analogous to mailing someone a letter as one can mail many letters, but no guarantee for the order of delivery.

Sending a datagram is analogous to mailing someone a letter as some mails might get lost along the way and not be recovered.

Sending a datagram is analogous to mailing someone a letter as each letter contains the address of the recipient, making the letter independent from all the others.

Datagram provides a connection-oriented service.

71
New cards

[APUE16] In a layered protocol architecture (e.g., TCP/IP), a benefit and rationale for a module at one layer relying on another module at the layer below for some service is:

The lower-layer module can extend its service to multiple modules at the higher layer

If called for, transparent to the higher-layer module, the lower-layer module can be replaced

The higher-layer module can dispense with coding the logic for that service

All of the above

All of the above

72
New cards

[APUE15] According to the authors. Which one of the following statements is CORRECT?

When a process is done with a shared resource that is controlled by a semaphore, the semaphore ______.

value is decremented by 1

value is set to 0

value is incremented by 1

value is not affected

goes in sleep

value is incremented by 1

73
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

FIFO is a type of file.

Creating a FIFO is similar to creating a file.

FIFOs are sometimes called anonymous pipes.

With FIFOs, unrelated processes can exchange data.

The pathname for a FIFO exists in the file system.

FIFOs are sometimes called anonymous pipes.

74
New cards

[APUE15] According to the authors. Consider the pclose call. Which one of the following statements is NOT correct?

The pclose function terminates the child process

The pclose function closes the standard I/O stream

The pclose function waits for the command to terminate

The pclose function returns the termination status of the shell

If the shell cannot be executed, the termination status of pclose is like shell exit(127).

The pclose function terminates the child process

75
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

Semaphore is a counter used to provide access to a shared data object for multiple processes.

If the value of the semaphore is positive, the process can use the resource.

To use a resource with a semaphore, the process increments the semaphore value by 1.

If the semaphore value is 0, the process to access the resource goes to sleep.

If the semaphore value gets greater than 0, then the process waiting wakes up to access it.

To use a resource with a semaphore, the process increments the semaphore value by 1.

76
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE? Consider the following code segment.int fd[2];pipe(fd);

fd[0] is open for reading.

fd[1] is open for writing.

With a duplex pipe if supported, fd[0] and fd[1] are open for both reading and writing.

The fstat function returns a file type of PIPE for the file descriptor of either end of a pipe.

One can test for a pipe with the S_ISFIFO macro.

The fstat function returns a file type of PIPE for the file descriptor of either end of a pipe.

77
New cards

[APUE15] According to the authors. When one end of a pipe is closed, two rules apply. Which one of the following statements is NOT correct?

If we read from a pipe whose write end has been closed, read returns 0 to indicate an end of file after all the data has been read.

One can write to a pipe whose write end has been closed.

If we read from a pipe whose write end has been closed, this end of file is not generated until there are no more writers for the pipe.

It's possible to duplicate a pipe descriptor so that multiple processes have the pipe open for writing.

Normally there is a single reader and a single writer for a pipe.

One can write to a pipe whose write end has been closed.

78
New cards

[APUE15] According to the authors. Consider the popen and pclose functions which will do ____. Which one of the following statements is NOT correct?

create a pipe

fork a parent process and a child process in a pipeline

close the unused ends of the pipe

execute a shell to run the command

wait for the command to terminate

fork a parent process and a child process in a pipeline

79
New cards

[APUE15] According to the authors. Consider a filter. Which one of the following statements is NOT correct?

A UNIX system filter is a program which reads from standard input and writes to standard output.

Filters are normally connected linearly in shell pipelines.

A filter becomes a coprocess when it generates the filter's input and reads the filter's output.

A coprocess normally runs in the background from a shell

The standard input and output of a coprocess are connected using a pipe.

A filter becomes a coprocess when it generates the filter's input and reads the filter's output.

80
New cards

APUE15] According to the authors. Which one of the following statements is CORRECT?When a process is done with a shared resource that is controlled by a semaphore, the semaphore ______.

value is decremented by 1

value is set to 0

value is incremented by 1

value is not affected

goes in sleep

value is incremented by 1

81
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

Semaphore is a counter used to provide access to a shared data object for multiple processes.

If the value of the semaphore is positive, the process can use the resource.

To use a resource with a semaphore, the process increments the semaphore value by 1.

If the semaphore value is 0, the process to access the resource goes to sleep.

If the semaphore value gets greater than 0, then the process waiting wakes up to access it.

To use a resource with a semaphore, the process increments the semaphore value by 1

82
New cards

[APUE15] According to the authors. Consider the popen call as shown below.fp = popen(cmdstring, "r");Which one of the following statements is NOT correct?

The file pointer returned is connected to the standard input of cmdstring

83
New cards

APUE15] According to the authors. Which one of the following statements is NOT correct?

Wring to a FIFO that no process has open for reading, the signal SIGPIPE is generated.

When a FIFO is closed, an end of file is generated for the reader of the FIFO.

It is common to have multiple writers for a given FIFO.

With multiple readers for a given FIFO, one needs to have atomic read.

PIPE_BUF specifies the maximum amount of data that can be written atomically to a FIFO

With multiple readers for a given FIFO, one needs to have atomic read

84
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE?

Pipes are the oldest form of UNIX System IPC.

Pipes are provided by all UNIX systems.

Pipes have been half duplex historically.

All Linux systems now provide full-duplex pipes.

Half-duplex pipes are still the most commonly used form of IPC.

All Linux systems now provide full-duplex pipes.

85
New cards

[APUE15] According to the authors. When one end of a pipe is closed, two rules apply. Consider the following code segment.int fd[2];pipe(fd);Which one of the following statements is CORRECT?

For a pipe from the parent to the child, the parent closes both fd[0] and fd[1].

For a pipe from the parent to the child, the parent closes fd[1], and the child closes fd[0].

For a pipe from the child to the parent, the parent closes fd[1], and the child closes fd[0].

For a pipe from the child to the parent, the parent closes fd[0], and the child closes fd[1].

For a pipe from the parent to the child, the child closes fd[0] of the parent.

For a pipe from the child to the parent, the parent closes fd[1], and the child closes fd[0].

86
New cards

[APUE15] According to the authors. Consider a filter. Which one of the following statements is NOT correct?

A UNIX system filter is a program which reads from standard input and writes to standard output.

Filters are normally connected linearly in shell pipelines.

A filter becomes a coprocess when it generates the filter's input and reads the filter's output.

A coprocess normally runs in the background from a shell

The standard input and output of a coprocess are connected using a pipe.

A filter becomes a coprocess when it generates the filter's input and reads the filter's output

87
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE?

Pipes can be used only between processes that have a common ancestor.

A pipe is created by a process with fork, to be used between the parent and the child.

UNIX domain sockets should be used to overcome the limitations of pipes.

Pipes cannot be used for any full-duplex IPC communication.

Pipes are used for a sequence of commands in a pipeline for the shell to execute.

Pipes cannot be used for any full-duplex IPC communication

88
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class.____ is about sharing of resources and costs with a large pool of usersWhich one of the following choices is Correct?Select the best answer.

Organizational Agility

Cost Reduction

Local Services

Easier Maintenance

Multitenancy

Multitenancy

89
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class.Public-cloud delivery model converts capital expenditures (e.g., buying servers) to operational expenditure. This lowers effectively barriers to entry, as infrastructure is typically provided by a third party and need not be purchased for one-time or infrequent intensive computing tasks.This generates or causes one of the following benefits.Which one of the following choices is Correct?

Organizational Agility

Cost Reduction

Global Services

Easier Maintenance

Multitenancy

Cost Reduction

90
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class.____ is about flexibility for users with re-provisioning, adding, or expanding technological infrastructure resources.Which one of the following choices is correct? Select the best answer.

Organizational Agility

Cost Increase

Global Services

Easier Maintenance

Multitenancy

Organizational Agility

91
New cards

Cloud] Consider the major benefits of Cloud Computing as discussed in the class.Enabling users to access systems using a web browser regardless of their location or what device they use (e.g., mobile phones, desktop or laptop) as infrastructure is off-site (provided by a third-party) and accessed via the Internet from anywhere.This generates or causes one of the following benefits.Which one of the following choices is Correct?Select the best answer.

Organizational Agility

Cost Reduction

Global Services

Easier Maintenance

Multitenanc

Global Services

92
New cards

[Cloud] Consider three models of Cloud Computing (NIST) as discussed in the class._____ is provided if the consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, or storage, but has control over the deployed applications and possibly configuration settings for the application-hosting environment.Which one of the following choices is correct?Select the best answer.

Software as a Service (SaaS)

Platform as a Service (PaaS)

Infrastructure as a Service (IaaS)

Application as a Service (AaaS)

Virtualization as a Service (VaaS)

Platform as a Service (PaaS)

93
New cards

Cloud] Consider the major benefits of Cloud Computing as discussed in the class.Pricing on a utility computing basis can be simplified or "fine-grained" with usage-based billing options. Cloud computing get the job done for users with less in-house IT skills than needed normally.This generates or causes one of the following benefits.Which one of the following choices is Correct? Select the best answer.

Organizational Agility

Cost Reduction

Global Services

Easier Maintenance

Multitenancy

Cost Reduction

94
New cards

[Cloud] Consider the Cloud Computing as discussed in the class.Cloud Computing is possible with the availability of ____.Which one of the following choices is NOT correct?

low-cost low-capacity networks

low-cost hardware (computers and storage devices)

the widespread adoption of hardware virtualization

service-oriented architecture

autonomic and utility computing

low-cost low-capacity networks

95
New cards

[Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class.Cloud systems automatically control and optimize resource use by leveraging a metering capability at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be monitored, controlled, and reported, providing transparency for both the provider and consumer of the utilized service.This is about _____.Select the best answer.

On-demand self-service

Broad network access

Resource pooling

Rapid elasticity

Measured service.

Measured service

96
New cards

Cloud] Consider the enabling technologies of Cloud Computing as discussed in the class.______ Model is broadly to any distributed application with 2-layers to distinguish service providers and service requestors.Which one of the following choices is correct? Select the best answer.

Client-Server

Grid Computing

Utility Computing

Fog Computing

Cloud-User Model

Client-Server

97
New cards

[Cloud] Consider three models of Cloud Computing (NIST) as discussed in the class.The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, storage, or even individual application capabilities, with the possible exception of limited user-specific application configuration settings.The capability provided to the consumer is to use the provider's applications running on a cloud infrastructure. The applications are accessible from various client devices through either a thin client interface, such as a web browser (e.g., web-based email), or a program interface.This describes one of three models of cloud computing (NIST).Which one of the following choices is correct?Select the best answer.

Software as a Service (SaaS)

Platform as a Service (PaaS)

Infrastructure as a Service (IaaS)

Application as a Service (AaaS)

Virtualization as a Service (VaaS)

Software as a Service (SaaS)

98
New cards

[Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class.Which one of the following choices is NOT correct?Select the best answer.

On-demand self-service

Broad network access

Resource pooling

Rapid elasticity

Telemarketing service.

Telemarketing service

99
New cards

[Cloud] Consider the Cloud Computing as discussed in the class.Cloud providers typically use a(n) ______ model which let user be accountable to its own use only.Which one of the following choices is Correct?

pay-as-you-go

rent-or-lease

lease-to-own

prorated-pay

accelerated-credit

pay-as-you-go

100
New cards

Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class.Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations).This is about _____.Select the best answer.

On-demand self-service

Broad network access

Resource pooling

Rapid elasticity

Measured service.

Broad network access