VOP_CREATE(9freebsd)

VOP_CREATE9freebsd

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

Usage

#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, char *target);

Overview

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) 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.

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

History

The function VOP_CREATE appeared in 4.3BSD.

Authors

This manual page was written by Doug Rabson.

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