Next: ptrace, Previous: fsync, Up: Syscalls   [Contents]


9.46 link ¶

int link(int dir_fd, const char *path, int path_len,
         const char *target, int target_len);

This syscall creates hard links, the paths are not dereferenced in the case of being symlinks.

The syscall returns 0 or -1 on failure, with the following errno:

  • EACCES: Bad memory addresses.
  • EINVAL: The passed path and target lengths are way too big.
  • EIO: Internal error.