It is an error for pathname to not specify an existing file or to refer to a directory.
ENODEV The device prefix of filename did not exist. ENOTDIR A non-final component of pathname was not a directory. EISDIR pathname referred to a directory. ENOENT The target file did not exist. EIO A hard I/O error occurred. EFAULT pathname was an invalid pointer.