Question: Q 1 . Write a program using dup ( ) / dup 2 ( ) to assign 1 as the duplicate file descriptor. Q 2

Q1. Write a program using dup()/dup2() to assign 1 as the duplicate
file descriptor.
Q2. Write a program to duplicate a file descriptor of a file. Use the old
file descriptor to read the first 5 characters and the new file descriptor
to append some new content to the file.
36
Q1. Write a program using fork() system call to create two child of the
same process i.e., Parent P having child process P1 and P2.
Q2. Write a program using fork() system call to create a hierarchy of 3
process such that P2 is the child of P1 and P1 is the child of P.
7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!