21⟩ What does exec family return?
When successful exec will not return, it will start
executing the new program
However if there is an- error exec returns -1 and sets the
errno to the appropriate value
“Linux System Calls frequently Asked Questions by expert members with experience in Linux System Calls. These interview questions and answers on Linux System Calls will help you strengthen your technical skills, prepare for the interviews and quickly revise the concepts. So get preparation for the Linux System Calls job interview”
When successful exec will not return, it will start
executing the new program
However if there is an- error exec returns -1 and sets the
errno to the appropriate value
Linux implements fork() via the clone() system call.
The clone() system call, in turn, calls do_fork().
The bulk of the work in forking is handled by do_fork(),
which is defined in kernel/fork.c.This function calls
copy_process() and then starts the process running.
If copy_process() returns successfully, the new child is
woken up and run. Deliberately, the kernel runs the child
process first.
You need to install an SSL certificate in apahce to secure
the transactions.
It contains all the kernel modules that needed to be loaded
into kernel (booting etc). there will some .map, .dep
(dependency files) files present.
When the kernel needs a feature that is not resident in the
kernel, the kernel module daemon kmod[1] execs modprobe to
load the module in.
You can see what modules are already loaded into the kernel
by running lsmod, which gets its information by reading the
file /proc/modules
Mainly hardware related information such as CPU
information, Memory (RAM) information stored under /proc
directory
example:
# cat /proc/cpuinfo (show the information of CPU of that
particular hardware)
# cat /proc/meminfo (show the information of Memory i.e.
RAM of that particular hardware)
kernel 2.6 introduces a new file naming convention: kernel
modules now have a .ko extension (in place of the old .o
extension) which easily distinguishes them from conventional
object files. The reason for this is that they contain an
additional .modinfo section that where additional
information about the module is kept.
Linux program modpost can be used to convert .o files into
.ko files.
ext3 is also same as the ext2, but journaling concept is introduced in ext3.
Compared to ext2, ext3 is slow. ext2 less secure compared to ext3. ext2 is less
Performance where as ext3 is very good performance.
resize2fs is only for ext2 filesystem but not ext3.
first unmount the partition
#umount /dev/sda1
#tune2fs -O ^has_journal /dev/sda1 #to remove journal from /dev/sda1
#e2fsck -f /dev/sda1
#resize2fs /dev/sda1 600M #resize the partition
ssh is secured shell, allows the user to login remotely with more secured.
whereas telnet also same but authentications like passwords, transfers over a network as text mode. so it is not good to use.
mainly spinlock used in threads to avoid synchronization,where as semaphore and mutex used to avoid process synchronization.
1.spinlock is something like polling.it spins for resouce until aloocated resouce releases.
2.binary semaphore and mutex are similar.
umask value = 022
Without a umask in effect,any file created will have 666
permissions.
666
022
---------
644
---------
A umask of 022 will result in files created with 666 permission.
atomic variables are the variables which can only be
manipulated atomically using atomic APIs. Linux declares
variable as atomic by using the type atomic_t. Basically
used a way to achieve synchronization.
an atomic operation is one which cannot be (or is not)
interrupted by concurrent operations and cannot be broken up
into smaller parts that could be performed by different
processors.
Atomic function is a function which is executed to
completion without interruption. Atomic function can also be
seen as a small critical section which is executed without
interruption, locking.
There are 2 situations when Linux can switch from user Space
to Kernel Space:-
1) by doing System calls
2) When interrupt comes (to handle interrupt)
3) by executing 128 (0x80 ) instruction or doing sysenter
Linux can switch from kernel Space to User space:-
1) process in kernel mode is preempted.
2) After completion of Interrupt handler / System call
3) performing sysexit sys call
insmod: insmod is a tool used to attach a module to the
running linux kernel. This will take the kernel object(.ko)
and takes all executable code and data sections of the .ko
and attach it to the running linux kernel.
rmmod: used to remove or deattach a module code from the
running kernel
RAID 1 is disk striping. no mirroring no parity. Minimum 2 disks required. If any
One disk fails all the data get lost.
RAID 5 is disk striping with parity. Minimum 3 disks required. if anyone disk fails
Data is safe, if two fails data get lost.