A C program "domath.c" utilizes the math library. Which of the following commands correctly creates the corresponding executable "domath"?
cc -o domath domath.c 0.0%
cc -o domath domath.c -L /usr/lib -lmath 0.0%
cc -o domath domath.c -lm 100.0%
cc -o domath domath.c -Lmath 0.0%
A process opens a file and forgets to close the file descriptor when it exits. What is the result?
It results in a resource leak. 0.0%
The OS calls exit on behalf of the process before it terminates the process resulting in all the resources being reclaimed. 0.0%
The OS garbage collector recovers the descriptor. 100.0%
By convention, which of the following signals causes a daemon to reload its configuration?
SIGHUP 100.0%
SIGKILL 0.0%
SIGINT 0.0%
SIGCONT 0.0%
How do threads created using pthread library share data between themselves efficiently?
They use one of the standard interprocess communication methods. 0.0%
They use sockets. 0.0%
They don't need any special mechanism as they share the data segment. 100.0%
They use shared memory. 0.0%
How do two threads synchronize access to shared data in a multi threaded application?
mutex_enter 0%
pthread_rwlock 0%
pthread_key_create 0%
pthread_mutex_lock 0%
How does a programmer distinguish a child from its parent process following a fork system call?
The system call returns 0 to the child and 1 to the parent. 0.0%
The system call returns 0 to the parent and the pid of the parent to the child. 0.0%
The system call returns 0 to the child and the pid of the child to the parent. 100.0%
There is no way to distinguish a child from its parent. 0.0%
How is the stack trace of all the threads in a multi threaded Linux application obtained?
strace -f -p <procid> 0.0%
"backtrace" at the gdb prompt. 0.0%
"thread apply all ::stack" at the gdb prompt. 0.0%
"thread apply all backtrace" at the gdb prompt. 100.0%
How is the value of the shell environment variable IFS changed to comma (',')?
IFS=','; export IFS 100.0%
$IFS=','; export IFS 0.0%
IFS=','; export $IFS 0.0%
$IFS=',' 0.0%
How many bytes of a file of size 1023 will be read by the following piece of code? char buf[256]; <snip> while (read(fd, buf, 256)) { /* Take some action */ } <snip>
1024 0.0%
1023 100.0%
0 0.0%
768 0.0%
If a process executes the following C code on a Linux system, what is the outcome? <snip> char *cp = 0, c = *cp; <snip>
The process executes the code without errors. 0.0%
The process is killed with a SIGSEGV. 100.0%
The process is killed with a SIGBUS. 0.0%
The process is killed with a SIGKILL. 0.0%
If a process has locked a System V Semaphore and receives a SIGKILL signal, which of the following is true?
The process can catch the signal and drop the semaphore before terminating. 0.0%
The process terminates without releasing the semaphore. 50.0%
The semaphore is released if the process had specified SEM_UNDO during creation. 50.0%
The signal is deferred until the semaphore is released. 0.0%
If a process is hung in the kernel context, sending it a SIGKILL will _____.
kill the process immediately. 0.0%
be ignored by the Operating System. 0.0%
be delivered when the process switches back to the user context. 100.0%
If a process is terminated due to a SEGFAULT on a Solaris 9 system, what is the name of the core file that is created?
core 100.0%
corefile 0.0%
memdump 0.0%
coredump 0.0%
If a write system call fails and if errno is set to EFAULT, what does it signify?
The system encountered an IO error while doing the write. 0.0%
The file descriptor was illegal. 0.0%
The write buffer is not legal. 100.0%
The file was removed by another process while this write was being attempted. 0.0%
Ignoring the setup cost for each of the System V IPC mechanisms, which of the following is the most efficient?
System V, Messages. 0.0%
System V, Shared Memory 100.0%
System V, Semaphores 0.0%
Sockets 0.0%
On Linux, the pthread_create interface does not use the fork system call to create threads.
Shared libraries increase an application's disk size?
The library routine printf does not use any system calls.
Threads created via pthread_create need to first set up shared memory using shmop before they can share data.
What are the typical system calls the Unix shell invokes when it has to execute a new command?
open, read, close. 0.0%
open, fork, exec. 100.0%
ioctl. 0.0%
What command is used to list the shared libraries used by an executable?
ldconfig 0.0%
ld 0.0%
ldd 100.0%
ls 0.0%
What does the '-pg' option of the Unix compiler do?
It turns on the profiling of the executable code. 100.0%
It generates an assembler listing of the code. 0.0%
It turns on the generation of the optimized code. 0.0%
It prints the different function call graphs. 0.0%
What does the "open" system call return to the caller?
0 on success and -1 on error. 0.0%
File descriptor. 0.0%
An integer greater than or equal to 0 on success and -1 on error. 100.0%
Always 0. 0.0%
What does the command "mknod temp p" do?
It creates a named pipe. 100.0%
It creates directory nodes "temp" and "p". 0.0%
It creates pipes "temp" and "p" 0.0%
What does the following command do to the process with pid 12345? "kill -9 12345".
It sends the INT signal causing the process to be interrupted. 0.0%
It sends the STOP signal causing the process to be stopped. 0.0%
It sends the KILL signal causing the process to be killed. 100.0%
It sends the HUP singal causing the process to hangup. 0.0%
What does the open system call return upon success?
A non zero value, which is the file descriptor. 0.0%
Zero. 0.0%
A positive integer which is the file descriptor. 100.0%
The pointer to the FILE structure of the open file. 0.0%
What is the default file descriptor used for the error outputs of a process?
0 0.0%
1 0.0%
2 100.0%
-1 0.0%
What is the effect of a process executing an unlink system call while another process has opened the same file?
The unlink system call will fail. 100.0%
The unlink system call will succeed and the other process will be terminated. 0.0%
The unlink system call will be blocked until the other process has closed all references to the file. 0.0%
The unlink system call will succeed. 0.0%
What is the effect of executing the following system call on the file "test.txt"? open("test.txt", O_TRUNC)
The file is truncated to the nearest block size before returning. 0.0%
The file is created before returning. 0.0%
The file is opened. 0.0%
If test.txt exists, the file is truncated to 0 bytes before returning. 100.0%
What is the effect of issuing a "$c" command at the adb prompt during a debugging session on a Solaris 9 system?
It generates a listing of the stack trace. 100.0%
It causes the debugger to continue. 0.0%
It drops to the shell. 0.0%
It prints the register contents. 0.0%
What is the effect of setting the "sticky" bit on an application's executable image?
It causes the system to load the program faster the next time it runs. 0.0%
It causes the system to fail all unlink system call requests on the image. 0.0%
It causes the system to preload the application's image into the system RAM. 0.0%
It causes the system to grant the application owner's privileges to other users if they try to run the application. 100.0%
What is the name of the standard linker on Unix?
cc 0.0%
ldd 0.0%
ld 100.0%
ls 0.0%
What is the network byte order in Unix?
Little Endian 0.0%
Big Endian 100.0%
It is negotiated during connection. 0.0%
It is undefined. 0.0%
What is the outcome of attempting an ioctl system call on a block device file?
The system returns ENOTTY. 0.0%
The ioctl succeeds and returns 0. 0.0%
The system returns EIO. 0.0%
The system returns ENXIO. 100.0%
Where are the DNS and search domains specified?
/etc/fstab 0.0%
/etc/nsswitch.conf 0.0%
/etc/resolv.conf 100.0%
/etc/hosts- 0.0%
Which library routine is used to translate the numeric system call error code to a human readable text error message?
sprintf 0.0%
exit 0.0%
error 100.0%
perror 0.0%
Which of the compiler options generates an assembler output file?
-O 0.0%
-a 0.0%
-S 100.0%
-g 0.0%
Which of the following are true of Unix system calls?
System calls are executed in "User" context. 0.0%
The routine "malloc" which is used for allocating memory is a system call. 50.0%
A new file can be created using the "open" system call. 50.0%
If two processes are executing the "write" system call simultaneously, they are serialized by the operating system. 0.0%
The "read" system call will never be blocked. 0.0%
Which of the following block sizes results in the best read/write performance for an IO intensive application?
8192 100.0%
4096 0.0%
2048 0.0%
1024 0.0%
Which of the following C headers needs to be included for socket programming?
<socket.h> 0.0%
<sys/socket.h> 100.0%
<stdio.h> 0.0%
<stdlib.h> 0.0%
Which of the following calls is used to initiate a socket connection to a target address?
socket 0.0%
connect 100.0%
accept 0.0%
listen 0.0%
Which of the following can be used to debug the process "123" and program "test" on a Linux system?
adb test 123 0.0%
gdb test 123 50.0%
strace 123 0.0%
strace -f -p 123 50.0%
Which of the following can be used to inspect the system call arguments of a Linux process?
strace 50.0%
gdb 50.0%
adb 0.0%
mdb 0.0%
Which of the following commands can be used on a Linux system to configure a network interface (card)?
ifconfig 100.0%
ipconfig 0.0%
netstat -c 0.0%
route 0.0%
Which of the following commands can be used on a Linux system to kill process 8977 and all its children?
kill -term 8977 100.0%
kill -kill 8977 0.0%
kill -stop 8977 0.0%
kill -int 8977 0.0%
Which of the following commands can be used to compile a C file called "test.c" into an executable called "test"?
cc -o test test.c 100.0%
cc -g -S test.c 0.0%
cc test test.c 0.0%
cc -E test.c 0.0%
Which of the following commands can be used to create a static (archive) library?
tar 0.0%
ar 100.0%
ld 0.0%
gcc 0.0%
Which of the following commands can be used to generate a listing of all the shared libraries that an executable needs?
ld 0.0%
ldd 100.0%
ls 0.0%
ln 0.0%
Which of the following commands can be used to install the native software package SOFTpkg on a Solaris system?
tar -xvf SOFTpkg 0.0%
swinstall -s `pwd` SOFTpkg 0.0%
rpm -i SOFTpkg 0.0%
pkgadd -d . SOFTpkg 100.0%
Which of the following commands can be used to list all the active TCP connections on a Linux system?
netstat -r 0.0%
netstat -t 100.0%
iptables -L 0.0%
route 0.0%
Which of the following commands can be used to list all the active TCP connections only on a Linux system?
netstat -r 0.0%
netstat -t 100.0%
iptables -L 0.0%
route 0.0%
Which of the following commands generates a listing of the system calls being executed by a program on Solaris?
ltrace 0.0%
tusc 0.0%
strace 0.0%
truss 100.0%
Which of the following compiler options links the standard math library to the executable?
-link -mathlib 0%
-linkmath 0%
-L math 0%
-lm 0%
Which of the following creates an IPC message channel?
id = msgget(key, 0700|IPC_CREAT); 100.0%
id = msgget(key, 0700, IPC_CREAT); 0.0%
id = msgctl(key, 0700|IPC_CREAT); 0.0%
id = msgctl(key, IPC_CREAT, 0700); 0.0%
Which of the following environment variables specifies the shared library search path?
SHARED_LIBRARIES 0.0%
SHLIB_PATH 50.0%
LD_LIBRARY_PATH 50.0%
LIBRARIES 0.0%
Which of the following gcc compiler options turns on optimization?
optimize 0.0%
O 100.0%
Opt 0.0%
-S 0.0%
Which of the following gcc options can be used to generate a position independent code on a Linux system?
-pic 100.0%
+z 0.0%
-b 0.0%
-mshared 0.0%
Which of the following gdb commands can be used to obtain the stack trace of all the threads of a multi threaded program running on Linux?
bt 0.0%
::stack 0.0%
$C 0.0%
thread apply all bt 100.0%
Which of the following IO mechanisms allows greater performance to concurrent IO-intensive applications?
Memory Mapped IO 100.0%
Read Ahead 0.0%
Direct IO (Filesystem locking is skipped) 0.0%
Async IO. 0.0%
Which of the following IPC message operations is performed to setup communication between arbitrary processes?
msgctl 0.0%
msgsnd 0.0%
msgrcv 0.0%
msgget 100.0%
Which of the following IPC shared memory sequences is correct?
shmctl, shmat, shmdt 0.0%
shmget, shmat, shmdt 100.0%
shmctl, shmget, shmat, shmdt 0.0%
shmat, shmdt 0.0%
Which of the following is employed by the operating system to speed up file IO on a Solaris system.
Inode Cache 0.0%
DNLC 0.0%
Buffer Cache 100.0%
Page Cache 0.0%
Which of the following is true of Unix system calls?
System calls cannot be executed by regular users. 0.0%
System calls are executed in the user context. 0.0%
System calls are executed in the kernel context. 100.0%
System calls cause a process switch. 0.0%
Which of the following ksh trap sequences causes the function 'handler' to be executed when the script exits?
trap handler EXIT 100.0%
trap EXIT handler 0.0%
set handler EXIT 0.0%
trap handler exit 0.0%
Which of the following libraries provides the POSIX thread implementation on Solaris?
libpthread 100.0%
libthread 0.0%
libnptl 0.0%
libc 0.0%
Which of the following Linux commands can be used to identify the processes consuming maximum resources (CPU, Memory)?
ps 50.0%
top 50.0%
lsof 0.0%
vmstat 0.0%
Which of the following methods can be used as a communication mechanism between two unrelated processes?
A pipe using the pipe system call. 33.0%
A named pipe using the mknod system call. 33.0%
Named sockets. 33.0%
Signals. 0.0%
Which of the following methods can be used to allocate and use memory on a Unix system?
brk 0.0%
sbrk 0.0%
malloc 50.0%
calloc 50.0%
Which of the following options of the compiler is turned on to generate additional debug information (like the source code) for debugging an application?
O 0.0%
S 0.0%
E 0.0%
g 100.0%
Which of the following options specifies a non standard library path during linking?
-l 0.0%
-L 100.0%
-o 0.0%
-g 0.0%
Which of the following redirects the standard error output of a command to the log file "error.log"?
"2>error.log" 100.0%
"2 0.0%
">error.log" 0.0%
"|error.log" 0.0%
Which of the following segments within the process address space are unique to each thread?
code. 0.0%
data. 0.0%
stack. 100.0%
bss. 0.0%
Which of the following sequences creates a socket based connection for communication?
open, listen, accept 0.0%
open, accept, listen 0.0%
socket, connect, accept, listen 0.0%
socket, connect, listen, accept 100.0%
Which of the following sequences prints all the second column fields of an input file "values.txt"?
awk "print $2" values.txt 0.0%
awk '{print $2}' values.txt 100.0%
awk '{print #2}' values.txt 0.0%
cut -2 values.txt 0.0%
Which of the following shell commands is useful in single stepping through a shell script?
set -x 0.0%
echo 0.0%
trap 100.0%
DEBUG 0.0%
Which of the following shell operators is used to send the standard output of the first command to the standard input of the second command?
& 0.0%
^ 0.0%
> 0.0%
| 100.0%
Which of the following shell operators redirects the standard input of the command being executed?
< 100.0%
> 0.0%
% 0.0%
@ 0.0%
Which of the following shell parameters contains the return value of the previously executed shell command?
$* 0.0%
$$ 0.0%
$? 100.0%
$! 0.0%
Which of the following signals are used by the Unix shell to implement job control?
SIGHUP 0.0%
SIGSTOP 50.0%
SIGCONT 50.0%
SIGINT 0.0%
Which of the following signals cannot be ignored by a process?
SIGHUP 0.0%
SIGINT 0.0%
SIGTERM 0.0%
SIGKILL 100.0%
Which of the following socket system calls creates a Unix Domain Socket connection?
socket(PF_UNIX, SOCK_STREAM, protocol) 100.0%
socket(PF_INET, SOCK_DGRAM, protocol) 0.0%
socket(PF_IPX, SOCK_RAW, protocol) 0.0%
socket(PF_LOCAL, SOCK_STREAM, protocol) 0.0%
Which of the following statements are true?
"wc -l" can be used to count the number of lines in the input. 50.0%
"find . -name '*.txt' -exec rm {} ;" removes all ".txt" files in the current directory hierarchy. 50.0%
"cc -x " can be used to generate the assembler listing of the C program file. 0.0%
"set -x" can be used within a ksh shell script to generate listing of shell commands while they are being executed. 0.0%
Which of the following system calls can be used to change process scheduling priority?
priority 0%
nice 0%
ulimit 0%
fcntl 0%
Which of the following system calls can be used to create device special files?
open 0.0%
mkfs 0.0%
touch 0.0%
mknod 100.0%
Which of the following system calls can be used to get the metadata of a file?
open 0.0%
stat 100.0%
fcntl 0.0%
ioctl 0.0%
Which of the following system calls can be used to send a message via a connected socket?
send 25.0%
sendto 25.0%
sendmsg 25.0%
write 25.0%
Which of the following system calls creates a named socket?
creat 0.0%
mknod 0.0%
bind 0.0%
socket 100.0%
Which of the following system calls increases the process priority?
priority 0.0%
nice 100.0%
ulimit 0.0%
fcntl 0.0%
Which of the following system calls is specific to debugging?
truss 0.0%
fcntl 0.0%
strace 0.0%
ptrace 100.0%
Which of the following system calls is the most memory efficient method of reading a file?
readv 0.0%
read 0.0%
mmap 100.0%
fcntl 0.0%
Which of the following utilities is used to generate a core file of a process on Linux?
gdb 50.0%
strace 50.0%
gcore 0.0%
objdump 0.0%
Which of the following utilities is used to search out regular expressions in the input?
cat 0.0%
grep 100.0%
head 0.0%
tail 0.0%
Which of the following utilities would you use on a standard Linux system to debug a running application?
gdb. 50.0%
ltrace. 0.0%
strace. 50.0%
ptrace. 0.0%
Which system call is used to send a signal to another process?
signal 0.0%
kill 100.0%
socket 0.0%
ioctl 0.0%