Question: Suppose that the File Descriptor Table (FDT), System File Table (SFT) and in-memory inode tables are as follows after a process A just starts. Process

 Suppose that the File Descriptor Table (FDT), System File Table (SFT)

Suppose that the File Descriptor Table (FDT), System File Table (SFT) and in-memory inode tables are as follows after a process A just starts. Process A's FDT System File Table inode table 0 STDIN inode, // input offset, count 1 STDOUT 2 STDERR 3 inode, // output offset, count 4 inode, // error offset, count user space kernel Suppose that a data file "mydatafile.txt" contains 1234567890", and file operations incur no error. Show the resulting FDT, SFT and inode table after the following code of process A is executed. Also, discuss what are the possible outputs. Code a) : int fd; char buf [5] = "WXYZ"; fd = open ("mydatafile.txt", O_RDONLY); fork(); read (fd, buf, 1); read (fd, buf+1, 1); printf ("%cfc ", buf[0], buf[1]); Code b): int fd; char buf[5] = "WXYZ" ; fork(); fd = open ("mydatafile.txt", O_RDONLY); read (fd, buf, 1); read (fd, buf+1, 1); printf ("%cfc ", buf[0], buf[1])

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 Databases Questions!