---
name: "VOP_CREATE"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/VOP_CREATE"
---

# VOP\_CREATE(9)

create a file, socket, fifo, device, directory or symlink

## NAME

**VOP\_CREATE**, **VOP\_MKNOD**, **VOP\_MKDIR**, **VOP\_SYMLINK** – create a file, socket, fifo, device, directory or symlink

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/vnode.h\>**

**#include \<sys/namei.h\>**

*int*\

**VOP\_CREATE**(*struct vnode \*dvp*, *struct vnode \*\*vpp*, *struct componentname \*cnp*, *struct vattr \*vap*);

*int*\

**VOP\_MKNOD**(*struct vnode \*dvp*, *struct vnode \*\*vpp*, *struct componentname \*cnp*, *struct vattr \*vap*);

*int*\

**VOP\_MKDIR**(*struct vnode \*dvp*, *struct vnode \*\*vpp*, *struct componentname \*cnp*, *struct vattr \*vap*);

*int*\

**VOP\_SYMLINK**(*struct vnode \*dvp*, *struct vnode \*\*vpp*, *struct componentname \*cnp*, *struct vattr \*vap*, *const char \*target*);

## DESCRIPTION

These entry points create a new file, socket, fifo, device, directory or symlink in a given directory.

The arguments are:

- *dvp*

  The locked vnode of the directory.

- *vpp*

  The address of a variable where the resulting locked vnode should be stored.

- *cnp*

  The pathname component created.

- *vap*

  The attributes that the new object should be created with.

- *target*

  The pathname of the target of the symlink.

These entry points are called after [VOP\_LOOKUP(9)](/VOP_LOOKUP/9.md) when an object is being created.

## LOCKS

The directory, *dvp* will be locked on entry and must remain locked on return. If the call is successful, the new object will be returned locked.

## RETURN VALUES

If successful, the vnode for the new object is placed in *\*vpp* and zero is returned. Otherwise, an appropriate error is returned.

## ERRORS

- \[ENOSPC\]

  The file system is full.

- \[EDQUOT\]

  The user's file system space or inode quota would be exceeded.

## SEE ALSO

[vnode(9)](/vnode/9.md), [VOP\_LOOKUP(9)](/VOP_LOOKUP/9.md)

## HISTORY

The function **VOP\_CREATE** appeared in 4.3BSD.

## AUTHORS

This manual page was written by Doug Rabson.
