VOP_LINK(9freebsd)

VOP_LINK9freebsd

Create a new name for a file

Usage

#include <sys/param.h>

#include <sys/vnode.h>

int

VOP_LINK(struct vnode *dvp, struct vnode *vp, struct componentname *cnp);

Overview

This links a new name in the specified directory to an existing file.

Its arguments are:

dvp

The vnode of the directory.

vp

The vnode of the file to be linked.

cnp

Pathname information about the file.

The pathname info should not be released on exit because it is done by the caller. The directory and file vnodes should not be released on exit.

Locks

VOP_LINK() expects the directory and file vnodes to be locked on entry and will leave the vnodes locked on return.

Return values

Zero is returned if the file was linked successfully, otherwise an error is returned.

Errors

[EMLINK]

The file has too many links.

[EPERM]

The file is immutable.

[EXDEV]

A hard link is not possible between different file systems.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 6 times.

  1. 5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11–13

Authors

This manual page was originally written by Doug Rabson.

From freebsd-manpages 12.2-2 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.