CSCE 3600 Exam 2 Review
____________ and ____________ are custom signals that can
be used for user-defined purposes, such as triggering specific
actions within a process.
A) - SIGHUP and SIGKILL
B) - SIGUSR1 and SIGUSR2
C) - SIGILL and SIGSEGV
D) - SIGINT and SIGKILL Correct Answer B) - SIGUSR1 and
SIGUSR2
________________ are programming constructs that set up a
group of parameters that identifies the process request and then
executes the hardware-dependent CPU instruction switch from
User Mode to kernel Mode.
A) - functions
B) - interrupts
C) - processes
D) - system calls Correct Answer D) - system calls
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(char *filename, int flags, mode_t mode);
The open function converts a filename to a file descriptor and
returns the descriptor number. The descriptor returned is always
the smallest descriptor that is not currently open in the process.
(T/F) Correct Answer True
,<sys/types.h> header defines the various data types used in
socket related functions. Choose the common types you
encounter here.
A) - ssize_t
B) - socklen_t
C) - size_t
D) - pid_t Correct Answer All the above
A) - ssize_t
B) - socklen_t
C) - size_t
D) - pid_t
A "strong" semaphore is one that always achieves mutual
exclusion. (T/F) Correct Answer True
A condition variable is used to wait until a particular condition
is true. Condition variables must be used in conjunction with a
mutex lock. (T/F) Correct Answer True
A deadlock might occur when one thread tries to send a message
from user A to user B while another tries to send a message
from user B to user A (T/F) Correct Answer True
A signal can be received at any time, and a signal handler can
execute at any time. (T/F) Correct Answer True
A special zombie process state represents terminated processes
(T/F) Correct Answer True
, A thread can be bound to multiple processes. (T/F) Correct
Answer False
After a successful call to execv (Select all that apply)
A) - execv returns the new process ID
B) - file descriptors other than 0, 1, 2 (stdin, stdout, and stderr)
are closed
C) -instructions are executed at the beginning of main()
D) - an executable specified as an argument to execv is loaded
Correct Answer C) -instructions are executed at the beginning
of main()
D) - an executable specified as an argument to execv is loaded
After a successful dup2() call, what is the relationship between
oldfd and newfd?
A) - They refer to different files
B) - They become disconnected from the file system
C) - They refer to the same file
D) - They no longer exist Correct Answer C) - They refer to
the same file
Application programs can convert back and forth between IP
addresses and dotted-decimal strings using the functions
_______________
A) - ntohs and htons
B) - ntohl and htonl
C) - inet_pton and inet_ntop
____________ and ____________ are custom signals that can
be used for user-defined purposes, such as triggering specific
actions within a process.
A) - SIGHUP and SIGKILL
B) - SIGUSR1 and SIGUSR2
C) - SIGILL and SIGSEGV
D) - SIGINT and SIGKILL Correct Answer B) - SIGUSR1 and
SIGUSR2
________________ are programming constructs that set up a
group of parameters that identifies the process request and then
executes the hardware-dependent CPU instruction switch from
User Mode to kernel Mode.
A) - functions
B) - interrupts
C) - processes
D) - system calls Correct Answer D) - system calls
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(char *filename, int flags, mode_t mode);
The open function converts a filename to a file descriptor and
returns the descriptor number. The descriptor returned is always
the smallest descriptor that is not currently open in the process.
(T/F) Correct Answer True
,<sys/types.h> header defines the various data types used in
socket related functions. Choose the common types you
encounter here.
A) - ssize_t
B) - socklen_t
C) - size_t
D) - pid_t Correct Answer All the above
A) - ssize_t
B) - socklen_t
C) - size_t
D) - pid_t
A "strong" semaphore is one that always achieves mutual
exclusion. (T/F) Correct Answer True
A condition variable is used to wait until a particular condition
is true. Condition variables must be used in conjunction with a
mutex lock. (T/F) Correct Answer True
A deadlock might occur when one thread tries to send a message
from user A to user B while another tries to send a message
from user B to user A (T/F) Correct Answer True
A signal can be received at any time, and a signal handler can
execute at any time. (T/F) Correct Answer True
A special zombie process state represents terminated processes
(T/F) Correct Answer True
, A thread can be bound to multiple processes. (T/F) Correct
Answer False
After a successful call to execv (Select all that apply)
A) - execv returns the new process ID
B) - file descriptors other than 0, 1, 2 (stdin, stdout, and stderr)
are closed
C) -instructions are executed at the beginning of main()
D) - an executable specified as an argument to execv is loaded
Correct Answer C) -instructions are executed at the beginning
of main()
D) - an executable specified as an argument to execv is loaded
After a successful dup2() call, what is the relationship between
oldfd and newfd?
A) - They refer to different files
B) - They become disconnected from the file system
C) - They refer to the same file
D) - They no longer exist Correct Answer C) - They refer to
the same file
Application programs can convert back and forth between IP
addresses and dotted-decimal strings using the functions
_______________
A) - ntohs and htons
B) - ntohl and htonl
C) - inet_pton and inet_ntop