xref: /freebsd/share/man/man9/VOP_CREATE.9 (revision a2f733abcff64628b7771a47089628b7327a88bd)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 1996 Doug Rabson
4.\"
5.\" All rights reserved.
6.\"
7.\" This program is free software.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28.\"
29.Dd November 2, 2018
30.Dt VOP_CREATE 9
31.Os
32.Sh NAME
33.Nm VOP_CREATE ,
34.Nm VOP_MKNOD ,
35.Nm VOP_MKDIR ,
36.Nm VOP_SYMLINK
37.Nd create a file, socket, fifo, device, directory or symlink
38.Sh SYNOPSIS
39.In sys/param.h
40.In sys/vnode.h
41.In sys/namei.h
42.Ft int
43.Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
44.Ft int
45.Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
46.Ft int
47.Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
48.Ft int
49.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "const char *target"
50.Sh DESCRIPTION
51These entry points create a new file, socket, fifo, device, directory or symlink
52in a given directory.
53.Pp
54The arguments are:
55.Bl -tag -width target
56.It Fa dvp
57The locked vnode of the directory.
58.It Fa vpp
59The address of a variable where the resulting locked vnode should be stored.
60.It Fa cnp
61The pathname component created.
62.It Fa vap
63The attributes that the new object should be created with.
64.It Fa target
65The pathname of the target of the symlink.
66.El
67.Pp
68These entry points are called after
69.Xr VOP_LOOKUP 9
70when an object is being created.
71.Sh LOCKS
72The directory,
73.Fa dvp
74will be locked on entry and must remain locked on return.
75If the call is successful, the new object will be returned locked.
76.Sh RETURN VALUES
77If successful, the vnode for the new object is placed in
78.Fa *vpp
79and zero is returned.
80Otherwise, an appropriate error is returned.
81.Sh ERRORS
82.Bl -tag -width Er
83.It Bq Er ENOSPC
84The file system is full.
85.It Bq Er EDQUOT
86The user's file system space or inode quota would be exceeded.
87.El
88.Sh SEE ALSO
89.Xr vnode 9 ,
90.Xr VOP_LOOKUP 9
91.Sh HISTORY
92The function
93.Nm
94appeared in
95.Bx 4.3 .
96.Sh AUTHORS
97This manual page was written by
98.An Doug Rabson .
99