WorksheetsLSP QUIZ
Total questions: 20
Worksheet time: 10mins
Addressing used in Application layer and Transport layer are:
Specific address and logical address
Port address and specific address
Specific address and service point
address
physical address and port
address
What type of address is used to identify a specific process on a host?
Logical address
MAC address
Port number
IP address
Identify the below address structure:
struct in_addr {
in_addr_t
s_addr; };
struct sockaddr_in {
uint8_t sin_len;
sa_family_t
sin_family;
in_port_t
sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
IPV4
IPV6
None
Both
In TCP connection termination final FIN Message is send from ___ to ______.
User, Client
Server, Client
Client, Server
Kernel, Server
The client process does not call bind() because
The server does the client
side binding
Kernel assigns an ephemeral port to
client process
Client side binding is not done
TCP assigns an ephemeral port to
the client process
Which one of the following socket API functions converts an unconnected active TCP socket into passive TCP socket.
connect()
listen()
accept ()
scoket()
What are the two operations that can be performed on semaphores?
sem_getvalue and sem_trywait
sem_open and sem_close
sem_post and sem_wait
sem_init and sem_destroy
What is the return value of sem_wait if it is successful?
Answer choices
errno
-1
0
1
What is the purpose of the sem_unlink function?
To initialize a semaphore
To retrieve the value of a semaphore
To destroy a semaphore
To unlink a named semaphore
What is a critical section?
A part of code that can be executed by multiple processes simultaneously
A part of code that manages shared resources in a mutually exclusive manner
A type of semaphore used in POSIX
A programming error that causes deadlock
What does the system() function do?
It reads data from a file.
It executes a shell command.
It writes data to a file.
It opens a file.
What does the read() function return on success?
The file descriptor.
A status code.
The number of bytes actually read.
The number of bytes requested.
What is the purpose of the open() function?
To close a file.
To associate a file descriptor with a file.
To write data to a file.
To read data from a file
Which of the following is a valid symbolic name for standard output?
STDERR
STDOUT_FILENO
STDIN_FILENO
STDERR_FILENO
Which command is an example of a filter in UNIX?
write
open
read
cat
What does the O_APPEND flag do?
It truncates a file.
It opens a file in read-only mode.
It appends data to the end of a file.
It creates a new file.
What is the purpose of the PATH variable in a shell?
It controls the permissions of files.
It sets the default shell for the user.
It stores the history of commands executed.
It defines the sequence of directories the shell searches for commands.
What does the '&' symbol do in a command line?
It runs the command in the foreground.
It runs the command in the background.
It terminates the command.
It pauses the command execution.
Which of the following is NOT a type of shell mentioned?
Bourne shell
C shell
Korn shell
Python shell
What does the command 'sleep 5' do?
Displays the current time.
Counts to five.
Runs the command in the background.
Pauses the execution for 5 seconds.
