⟩ Which of the following is considered as the super daemon in Unix? a) sysinit b) init c) inetd d) proc
b) init
b) init
What is the default number of files open per user process? a) 0 b) 1 c) 2 d) 3
What is the use of fcntl function? a) locking a file b) reading the file descriptor flag c) changing the file status flag d) all the above
The file system information is stored in a) Boot block b) Super Block c) Inode Table d) Data Block
read() system call on success returns a) 0 b) -1 c) number of character d) none
namei() is a) ANSI C library function b) C library function c) System call d) kernel routine
How do you rename file "new" to file "old"? a) mv new old b) move new old c) cp new old d) rn new old
If one of the thread in multi-threaded process is blocked on an I/O, which of the following is true? a) The entire process with block if their is no kernel supported threads b) Other threads of the process will continue to execute even if there is no kernel supported threads c) It depends on specific implementatation d) All of the above
Given a code snippet below? #define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) int main() { int fd1, fd2; umask(0); fd1 = open("file1", O_CREAT | O_RDWR, PERMS) umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); fd2 = open("file2", O_CREAT | O_RDWR, PERMS) return 0; } The newly created files file1 and file2 will have the permissions respectively a) rw-rw-rw- r--- b) r--- rw-rw-rw- c) rw-rw-rw- rw--- d) None of the above
What is stored in logfile as per below mentioned code if we execute ./a.out > logfile? int main() { int fd; close(1); fd = open("logfile",O_RDWR, 0744); write(fd, "Hello", 5); printf("Worldn"); return 0; } a) Hello b) HelloWorld c) World d) None
Code snippet (file1 size is 2024) f1 = fopen (file1, RDWR, RWX) lseek(f1,1024,SEEK_SET) write(f1,buf,10) What is offset now. a) 1024 b) 1034 c) 2034 d) 2054