1.

write system call returns -1 when ___________(a) if disk fills up while write is in progress(b) when file doesn’t exist(c) if the file size exceeds the system’s limit(d) if disk fills up while write is in progress and if the file size exceedsI had been asked this question in an interview for job.My question comes from System Calls Basics topic in chapter System Programming I – Files of Unix

Answer»

The CORRECT choice is (d) if disk fills up while WRITE is in progress and if the file size EXCEEDS

To explain I would say: write system call RETURNS the number of characters WRITTEN. However, it will return -1 if if disk fills up while write is in progress or if the file size exceeds the system’s limit.



Discussion

No Comment Found

Related InterviewSolutions