xref: /freebsd/share/man/man9/VOP_CREATE.9 (revision 8881d206f4e68b564c2c5f50fc717086fc3e827a)
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.\" $FreeBSD$
30.\"
31.Dd November 2, 2018
32.Dt VOP_CREATE 9
33.Os
34.Sh NAME
35.Nm VOP_CREATE ,
36.Nm VOP_MKNOD ,
37.Nm VOP_MKDIR ,
38.Nm VOP_SYMLINK
39.Nd create a file, socket, fifo, device, directory or symlink
40.Sh SYNOPSIS
41.In sys/param.h
42.In sys/vnode.h
43.In sys/namei.h
44.Ft int
45.Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
46.Ft int
47.Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
48.Ft int
49.Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap"
50.Ft int
51.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" "struct componentname *cnp" "struct vattr *vap" "const char *target"
52.Sh DESCRIPTION
53These entry points create a new file, socket, fifo, device, directory or symlink
54in a given directory.
55.Pp
56The arguments are:
57.Bl -tag -width target
58.It Fa dvp
59The locked vnode of the directory.
60.It Fa vpp
61The address of a variable where the resulting locked vnode should be stored.
62.It Fa cnp
63The pathname component created.
64.It Fa vap
65The attributes that the new object should be created with.
66.It Fa target
67The pathname of the target of the symlink.
68.El
69.Pp
70These entry points are called after
71.Xr VOP_LOOKUP 9
72when an object is being created.
73.Sh LOCKS
74The directory,
75.Fa dvp
76will be locked on entry and must remain locked on return.
77If the call is successful, the new object will be returned locked.
78.Sh RETURN VALUES
79If successful, the vnode for the new object is placed in
80.Fa *vpp
81and zero is returned.
82Otherwise, an appropriate error is returned.
83.Sh ERRORS
84.Bl -tag -width Er
85.It Bq Er ENOSPC
86The file system is full.
87.It Bq Er EDQUOT
88The user's file system space or inode quota would be exceeded.
89.El
90.Sh SEE ALSO
91.Xr vnode 9 ,
92.Xr VOP_LOOKUP 9
93.Sh HISTORY
94The function
95.Nm
96appeared in
97.Bx 4.3 .
98.Sh AUTHORS
99This manual page was written by
100.An Doug Rabson .
101