Course Homepage

HW6

  1. Write a snippet of C code that uses the system call we discussed in class to open a file named “hello.c” for reading.

  2. What is the full path of this file if the current working directory of the process is /tmp/?

  3. What can you pass to the system call to tell the kernel to create the file if it doesn’t exist already (hint: see man 2 open).

  4. What might it mean if the error code is ENOENT?