Operating System


Q241.

Consider the following code fragment: if (fork() == 0) { a = a + 5; printf("%d,%dn", a, &a); } else { a = a - 5; printf("%d, %dn", a, &a); } Let u, v be the values printed by the parent process, and x, y be the values printed by the child process. Which one of the following is TRUE?
GateOverflow

Q242.

Consider the execution of the following commands in a shell on a Linux operating system. bash$ cat alpha Mathematics bash$ In alpha beta bash$ rm alpha bash$ cat >> beta << SAME Information Technology SAME bash$ cat beta The output of the last command will be:
GateOverflow

Q243.

A process executes the following codefor (i = 0; i < n; i + +) fork( );The total number of child processes created is
GateOverflow

Q244.

A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory. ln -s file 1 file 2 ln -s file 2 file 3 Which of the following types of information would be lost from her file system? I.Hobbies II.Friends III.Courses
GateOverflow

Q245.

Which of the following system calls results in the sending of SYN packets?
GateOverflow

Q246.

A process executes the following segment of code : for(i = 1; i <= n; i++) fork (); The number of new processes created is
GateOverflow

Q248.

Which of the following commands or sequences of commands will rename a file x to file y in a Unix system ? I. mv y, x II. mv x, y III. cp y, x (rm x) IV. cp x, y (rm x)
GateOverflow

Q249.

When an interrupt occurs, an operating system
GateOverflow

Q250.

System calls are usually invoked by using
GateOverflow