Question: The Linux programming interface (book) page 111 5-6. After each of the calls to write() in the following code, explain what the content of the
The Linux programming interface (book) page 111
5-6. After each of the calls to write() in the following code, explain what the content of the output file would be, and why:
fd1 = open(file, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); fd2 = dup(fd1); fd3 = open(file, O_RDWR); write(fd1, "Hello,", 6);
write(fd2, "world", 6); lseek(fd2, 0, SEEK_SET); write(fd1, "HELLO,", 6); write(fd3, "Gidday", 6);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
