Unix System Calls Interview Questions And Answers
Download Unix System Calls Interview Questions and Answers PDF
Prepare comprehensively for your Unix System Calls interview with our extensive list of 7 questions. Each question is designed to test and expand your Unix System Calls expertise. Suitable for all experience levels, these questions will help you prepare thoroughly. Download the free PDF to have all 7 questions at your fingertips. This resource is designed to boost your confidence and ensure you're interview-ready.
7 Unix System Calls Questions and Answers:
Unix System Calls Job Interview Questions Table of Contents:
1 :: How to protect a process from others to kill?
by using signal handler block the signal for SIGKILL so that kill-9 will be handled.
Read More2 :: Explain c program to implement the Unix or Linux command to implement
ls -l >output.txt?
read the files in current directory using opendir and
readdir system calls. readdir will return filenames in the
directory. For each entry returned by readdir system call,
use stat system call to read statistics of the file. Stat
system call will give all the info about the file as that
of ls -l command.
Read Morereaddir system calls. readdir will return filenames in the
directory. For each entry returned by readdir system call,
use stat system call to read statistics of the file. Stat
system call will give all the info about the file as that
of ls -l command.
3 :: What is the difference between command and utility in Unix?
both the command and utility are give the same priority but
to give the diff between them we have only a major diff and
it is
utilites in unix will say how the commands are been
implimenting
command will come under the utilites
they are mainly 5 utilies in unix operating system and they
are
1.file processing utilites
2.disk processing utilites
3.process utilites
4.network utilites
5.text processing utilites
Read Moreto give the diff between them we have only a major diff and
it is
utilites in unix will say how the commands are been
implimenting
command will come under the utilites
they are mainly 5 utilies in unix operating system and they
are
1.file processing utilites
2.disk processing utilites
3.process utilites
4.network utilites
5.text processing utilites
4 :: Explain the mount and unmount system calls?
mount is the command used to know which devices are
loaded.it means devices like floppy drive,cd drive.if we
give mount command it will display which device is mounted.
unmount is the command used to disable the device.if we
give umount and the path of the device then it will umount
the device.
In windows we wont have this concept.because those are
installed.
Read Moreloaded.it means devices like floppy drive,cd drive.if we
give mount command it will display which device is mounted.
unmount is the command used to disable the device.if we
give umount and the path of the device then it will umount
the device.
In windows we wont have this concept.because those are
installed.
5 :: Explain What are the Unix system calls for I/O?
open(pathname,flag,mode) - open file
creat(pathname,mode) - create file
close(filedes) - close an open file
read(filedes,buffer,bytes) - read data from an open file
write(filedes,buffer,bytes) - write data to an open file
lseek(filedes,offset,from) - position an open file
dup(filedes) - duplicate an existing file descriptor
dup2(oldfd,newfd) - duplicate to a desired file descriptor
fcntl(filedes,cmd,arg) - change properties of an open file
ioctl(filedes,request,arg) - change the behaviour of an open
file
The difference between fcntl anf ioctl is that the former is
intended for any open file,
while the latter is for device-specific operations.
Read Morecreat(pathname,mode) - create file
close(filedes) - close an open file
read(filedes,buffer,bytes) - read data from an open file
write(filedes,buffer,bytes) - write data to an open file
lseek(filedes,offset,from) - position an open file
dup(filedes) - duplicate an existing file descriptor
dup2(oldfd,newfd) - duplicate to a desired file descriptor
fcntl(filedes,cmd,arg) - change properties of an open file
ioctl(filedes,request,arg) - change the behaviour of an open
file
The difference between fcntl anf ioctl is that the former is
intended for any open file,
while the latter is for device-specific operations.
6 :: The very first process created by the Kernel in UNIX is?
When the kernel begins to run, it starts by setting up a
number of internal lists, or tables.After initializing its
tables, the kernel creates three dummy processes; sched,
vhand and bdflush (with process IDs 0, 2 and 3
respectively). Finally the kernel creates a third process
init which pid 1. init starts up as a dummy process, then
achieves independence and runs as the first true process on
the system.
Read Morenumber of internal lists, or tables.After initializing its
tables, the kernel creates three dummy processes; sched,
vhand and bdflush (with process IDs 0, 2 and 3
respectively). Finally the kernel creates a third process
init which pid 1. init starts up as a dummy process, then
achieves independence and runs as the first true process on
the system.