CSCI - 330 - Post Mid-Term. Egg Edition
C library function exit terminates a process and allows to set the return status. A status of 0 indicates failure.
False
In C++, C strings are handled the same way as instances of the standard string class.
False
Only the superuser can create periodically running jobs via crontab.
False
The C structure dirent does not contain the file name.
False
The TCP protocol uses a datagram as message.
False
The accept system call is used in UDP server programming.
False
The fork system call duplicates the current process. The 2 processes (old and newly created) are exactly the same.
False
The only way to create a new user on Linux Mint is to use the GUI dialog "Users and Groups".
False
The pipe system call creates a bidirectional data channel.
False
The read and write system calls use C++ strings to handle its data.
False
The socket programming concept was first introduced as part of Windows 2000.
False
Upon success, the opendir function returns a file descriptor for the directory.
False
a user can belong to only one group.
False
getaddrinfo is a Unix system call?
False
open, close, create, read and write are system calls to achieve low-level I/O.
False
Which of the following protocols is not part of the OSI model transport layer?
HTTP
A socket is end-point of a communication link, it is identified by _______ address and _______ number.
IP port
Which of the following is not a technology used in the physical layer of the OSI model?
TCP
In the OSI reference model complexities of communication are organized into successive layers of protocols: lower-level layers are more specific to medium, higher-level layers are more specific to application.
Transport Layer - provides functions to guarantee reliable network link Network Layer - establishes, maintains and terminates network connections Data Link Layer - ensures the reliability of link Physical Layer - controls transmission of the raw bit stream over the medium
A process is a program in execution.
True
A protocol describes the syntax, semantics, and synchronization of communication
True
C++ can call functions from the standard C library.
True
Do these exec functions match to their description? execl, execlp - specify arguments as list execv, execvp - specify arguments as array of strings execlp, execvp - look for new executable via PATH
True
For the strcpy C library function, the size of the destination array must be long enough to contain the source string including the terminating null character.
True
In Unix there is one logical file system that is constructed from one or more physical file systems.
True
Only users or groups that are listed in /etc/sudoers can execute commands as super user.
True
System calls pipe, dup and fork are used together to implement the "|" pipe character used by the command interpreter on the command line.
True
System calls typically set the errno variable and return -1 if they encounter and error.
True
TCP is the transmission control protocol that is connection oriented and guarantees delivery.
True
The C library function perror translate an error code into an understandable error message.
True
The dup system call can be used in a forking TCP server to simplify sending responses to the client.
True
The dup system call is used to claim standard I/O from inside a program.
True
The listen system call allows to specify the length of the incoming queue.
True
The readdir function returns a structure which contains the name of the directory entry.
True
Unix processes can communicate via Unix pipes.
True
Which of the following is not a usual way to install new software on Linux?
Update Manger
In C++ what is the correct include to use the strlen or strcpy library functions?
#include <cstring>
Which of the following files is not involved in storing user information?
/etc/root
Which of the following is not a potential return value from the fork system call?
1, to indicate that 1 child process was created
Which number represents the strongest signal that can be sent to a process?
9
Which service resolves FQDN into IP address?
DNS
A C++ program cannot access environment variables.
False
A program can be running in the foreground and background at the same time.
False
A system call is linked to an executable and becomes logically part of the executable.
False
A system call uses a special C++ syntax for invocation.
False
Both IPv4 and IPv6 addresses are 32 bit long.
False
Which layer in the OSI model provides addressing via an IP address?
Network layer
Which of the following is not a valid flag to for the open system call?
O_READ
OSI in the OSI reference model stands for:
Open Systems Interconnection
What are each port associated with? Port 22 Port 25 Port 80 Port 53
Port 22 - Secure Shell (SSH) Port 25 - Simple Mail Transfer Protocol (SMTP) Port 80 - Hypertext Transfer Protocol (HTTP) used in the World Wide Web Port 53 - Domain Name System
The TCP 3-way handshake consist of which sequence of messages?
SYN SYN,ACK(SYN) ACK(SYN)
What is the purpose of the htons library function?
convert a host integer into a network 2 byte integer
C++ uses what to identify a file in low-level IO using system calls?
file descriptor number
Which system call creates a new process?
fork
A typical TCP server uses what to reduce client waiting time
fork to create a child process for the client request
What does this command do: mount /dev/sdb1 /mnt/extra
it makes the first partition on disk sdb available as logical directory /mnt/extra
Which command shows the jobs for a user:
jobs
What is the command to send a signal to a process?
kill
What is the command to create a file system on a physical device?
mkfs
Which of the following is not a file format used to package Linux software?
mp4
Which of to following is a system call that can be used to create a file?
open
Which C library functions enable directory I/O?
opendir,readdir
A ___________ describes the syntax, semantics, and synchronization of communication.
protocol
The C regular expression library uses 2 functions: regcomp and regexec. Which statement is true about these functions?
regexec runs the search that was prepared by regcomp
What do the system calls to their functionality? socket bind sendto recvfrom
socket - create a new communication endpoint bind - attach a local address to a socket sendto - send(write) some data over the connection recvfrom - receive(read) some data over the connection
Which UNIX command is used to change the login password?
sudo passwd root
A Unix pipe is represented in C++ as an array of _____ file descriptors.
two
Which system call is used to remove a file?
unlink
How long does the wait system call wait?
until a child process terminates
For the read system call, what can we program to allow an unlimited amount of data being read?
use a loop to read fixed chunks of data!