A component of the path prefix is not a directory.
A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.
The named file does not exist.
Search permission is denied for a component of the path prefix.
The named file is not writable by the user.
Too many symbolic links were encountered in translating the pathname.
The named file is a directory.
The named file resides on a read-only file system.
The file is a pure procedure (shared text) file that is being executed.
An I/O error occurred updating the inode.
Path points outside the process's allocated address space.
The fd is not a valid descriptor.
The fd references a socket, not a file.
4.4BSD, SVr4 (these function calls first appeared in BSD 4.2). SVr4 documents additional truncate error conditions EINTR, EMFILE, EMULTIHP, ENAMETOOLONG, ENFILE, ENOLINK, ENOTDIR. SVr4 documents for ftruncate additional EAGAIN and EINTR error conditions. POSIX has ftruncate but not truncate.