xref: /openbsd-src/share/man/man9/VOP_LOOKUP.9 (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1.\" $OpenBSD: VOP_LOOKUP.9,v 1.25 2013/10/07 01:50:26 guenther Exp $
2.\"
3.\" Copyright (c) 2003 Ted Unangst
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.Dd $Mdocdate: October 7 2013 $
27.Dt VOP_LOOKUP 9
28.Os
29.Sh NAME
30.Nm VOP_LOOKUP
31.Nd vnode operations
32.Sh SYNOPSIS
33.In sys/vnode.h
34.Ft int
35.Fo VOP_ABORTOP
36.Fa "struct vnode *dvp"
37.Fa "struct componentname *cnp"
38.Fc
39.Ft int
40.Fo VOP_ACCESS
41.Fa "struct vnode *vp"
42.Fa "int mode"
43.Fa "struct ucred *cred"
44.Fa "struct proc *p"
45.Fc
46.Ft int
47.Fo VOP_ADVLOCK
48.Fa "struct vnode *vp"
49.Fa "void *id"
50.Fa "int op"
51.Fa "struct flock *fl"
52.Fa "int flags"
53.Fc
54.Ft int
55.Fo VOP_BMAP
56.Fa "struct vnode *vp"
57.Fa "daddr_t bn"
58.Fa "struct vnode **vpp"
59.Fa "daddr_t *bnp"
60.Fa "int *runp"
61.Fc
62.Ft int
63.Fo VOP_BWRITE
64.Fa "struct buf *bp"
65.Fc
66.Ft int
67.Fo VOP_CLOSE
68.Fa "struct vnode *vp"
69.Fa "int fflag"
70.Fa "struct ucred *cred"
71.Fa "struct proc *p"
72.Fc
73.Ft int
74.Fo VOP_CREATE
75.Fa "struct vnode *dvp"
76.Fa "struct vnode **vpp"
77.Fa "struct componentname *cnp"
78.Fa "struct vattr *vap"
79.Fc
80.Ft int
81.Fo VOP_FSYNC
82.Fa "struct vnode *vp"
83.Fa "struct ucred *cred"
84.Fa "int waitfor"
85.Fa "struct proc *p"
86.Fc
87.Ft int
88.Fo VOP_GETATTR
89.Fa "struct vnode *vp"
90.Fa "struct vattr *vap"
91.Fa "struct ucred *cred"
92.Fa "struct proc *p"
93.Fc
94.Ft int
95.Fo VOP_INACTIVE
96.Fa "struct vnode *vp"
97.Fa "struct proc *p"
98.Fc
99.Ft int
100.Fo VOP_IOCTL
101.Fa "struct vnode *vp"
102.Fa "u_long command"
103.Fa "void *data"
104.Fa "int fflag"
105.Fa "struct ucred *cred"
106.Fa "struct proc *p"
107.Fc
108.Ft int
109.Fo VOP_ISLOCKED
110.Fa "struct vnode *vp"
111.Fc
112.Ft int
113.Fo VOP_KQFILTER
114.Fa "struct vnode *vp"
115.Fa "struct knote *kn"
116.Fc
117.Ft int
118.Fo VOP_LINK
119.Fa "struct vnode *dvp"
120.Fa "struct vnode *vp"
121.Fa "struct componentname *cnp"
122.Fc
123.Ft int
124.Fo VOP_LOCK
125.Fa "struct vnode *vp"
126.Fa "int flags"
127.Fa "struct proc *p"
128.Fc
129.Ft int
130.Fo VOP_LOOKUP
131.Fa "struct vnode *dvp"
132.Fa "struct vnode **vpp"
133.Fa "struct componentname *cnp"
134.Fc
135.Ft int
136.Fo VOP_MKDIR
137.Fa "struct vnode *dvp"
138.Fa "struct vnode **vpp"
139.Fa "struct componentname *cnp"
140.Fa "struct vattr *vap"
141.Fc
142.Ft int
143.Fo VOP_MKNOD
144.Fa "struct vnode *dvp"
145.Fa "struct vnode **vpp"
146.Fa "struct componentname *cnp"
147.Fa "struct vattr *vap"
148.Fc
149.Ft int
150.Fo VOP_OPEN
151.Fa "struct vnode *vp"
152.Fa "int mode"
153.Fa "struct ucred *cred"
154.Fa "struct proc *p"
155.Fc
156.Ft int
157.Fo VOP_PATHCONF
158.Fa "struct vnode *vp"
159.Fa "int name"
160.Fa "register_t *retval"
161.Fc
162.Ft int
163.Fo VOP_POLL
164.Fa "struct vnode *vp"
165.Fa "int events"
166.Fa "struct proc *p"
167.Fc
168.Ft int
169.Fo VOP_PRINT
170.Fa "struct vnode *vp"
171.Fc
172.Ft int
173.Fo VOP_READ
174.Fa "struct vnode *vp"
175.Fa "struct uio *uio"
176.Fa "int ioflag"
177.Fa "struct ucred *cred"
178.Fc
179.Ft int
180.Fo VOP_READDIR
181.Fa "struct vnode *vp"
182.Fa "struct uio *uio"
183.Fa "struct ucred *cred"
184.Fa "int *eofflag"
185.Fc
186.Ft int
187.Fo VOP_READLINK
188.Fa "struct vnode *vp"
189.Fa "struct uio *uio"
190.Fa "struct ucred *cred"
191.Fc
192.Ft int
193.Fo VOP_REALLOCBLKS
194.Fa "struct vnode *vp"
195.Fa "struct cluster_save *buflist"
196.Fc
197.Ft int
198.Fo VOP_RECLAIM
199.Fa "struct vnode *vp"
200.Fa "struct proc *p"
201.Fc
202.Ft int
203.Fo VOP_REMOVE
204.Fa "struct vnode *dvp"
205.Fa "struct vnode *vp"
206.Fa "struct componentname *cnp"
207.Fc
208.Ft int
209.Fo VOP_RENAME
210.Fa "struct vnode *fdvp"
211.Fa "struct vnode *fvp"
212.Fa "struct componentname *fcnp"
213.Fa "struct vnode *tdvp"
214.Fa "struct vnode *tvp"
215.Fa "struct componentname *tcnp"
216.Fc
217.Ft int
218.Fo VOP_REVOKE
219.Fa "struct vnode *vp"
220.Fa "int flags"
221.Fc
222.Ft int
223.Fo VOP_RMDIR
224.Fa "struct vnode *dvp"
225.Fa "struct vnode *vp"
226.Fa "struct componentname *cnp"
227.Fc
228.Ft int
229.Fo VOP_SETATTR
230.Fa "struct vnode *vp"
231.Fa "struct vattr *vap"
232.Fa "struct ucred *cred"
233.Fa "struct proc *p"
234.Fc
235.Ft int
236.Fo VOP_STRATEGY
237.Fa "struct buf *bp"
238.Fc
239.Ft int
240.Fo VOP_SYMLINK
241.Fa "struct vnode *dvp"
242.Fa "struct vnode **vpp"
243.Fa "struct componentname *cnp"
244.Fa "struct vattr *vap"
245.Fa "char *target"
246.Fc
247.Ft int
248.Fo VOP_UNLOCK
249.Fa "struct vnode *vp"
250.Fa "int flags"
251.Fa "struct proc *p"
252.Fc
253.Ft int
254.Fo VOP_WRITE
255.Fa "struct vnode *vp"
256.Fa "struct uio *uio"
257.Fa "int ioflag"
258.Fa "struct ucred *cred"
259.Fc
260.Sh DESCRIPTION
261The
262.Nm VOP
263functions implement a generic way to perform operations on vnodes.
264The VOP function called passes the arguments to the correct file system
265specific function.
266Not all file systems implement all operations, in which case a generic
267method will be used.
268These functions exist to provide an abstract method to invoke vnode
269operations without needing to know anything about the underlying file system.
270Many system calls map directly to a specific VOP function.
271.Pp
272The arguments for each VOP
273function consist of one or more vnode pointers along with other data
274needed to perform the operation.
275Care must be taken to obey the vnode locking discipline when using
276VOP functions.
277Many VOP calls take a
278.Vt struct proc *p
279argument.
280This should be the current process.
281VOP calls are not safe to call in an interrupt context.
282.Pp
283The following sections comment on the VOP functions from the consumer's
284perspective.
285.Pp
286.Bl -tag -width Ds -compact
287.It Fn VOP_ABORTOP dvp cnp
288Abort any asynchronous operations pending on the vnode
289.Fa dvp
290associated with the path name
291.Fa cnp .
292This is mostly used by internal VFS code and should not be needed by
293file system implementors.
294.Pp
295.It Fn VOP_ACCESS vp mode cred p
296Determine if the locked vnode
297.Fa vp
298can be accessed by the calling process
299.Fa p
300with credentials
301.Fa cred
302for the given access
303.Fa mode .
304.Pp
305.Fa mode
306may contain any of the following values:
307.Pp
308.Bl -tag -width Ds -compact -offset indent
309.It Dv VWRITE
310check writeability
311.It Dv VREAD
312check readability
313.It Dv VEXEC
314check executability
315.El
316.Pp
317If the access check succeeds, zero is returned; otherwise, an
318appropriate error code is returned.
319.Pp
320.It Fn VOP_ADVLOCK vp id op fl flags
321Perform advisory locking on the vnode
322.Fa vp
323according to the operation
324.Fa op
325and lock specification
326.Fa fl .
327.Fa id
328identifies the resource holding the lock
329(typically a pointer to the holding process).
330.Pp
331.Fa op
332may be one of the following operations:
333.Pp
334.Bl -tag -width F_GETLK -compact -offset indent
335.It Dv F_GETLK
336Get the first lock that would block a lock request.
337.It Dv F_SETLK
338Set a lock.
339.It Dv F_UNLCK
340Release a lock.
341.El
342.Pp
343.Fa flags
344may contain the following flags:
345.Pp
346.Bl -tag -width F_POSIX -compact -offset indent
347.It Dv F_WAIT
348If required, block waiting to obtain an exclusive lock.
349.It Dv F_POSIX
350Follow
351.Tn POSIX
352locking semantics; see
353.Xr fcntl 2 .
354.It Dv F_FLOCK
355Follow
356.Xr flock 2
357locking semantics.
358.El
359.Pp
360Upon success, zero is returned; otherwise, an appropriate error code is
361returned.
362.Pp
363.It Fn VOP_BMAP vp bn vpp bnp runp
364Convert the logical block number
365.Fa bn
366of the file the locked vnode
367.Fa vp
368is associated with to its physical number on-disk.
369The physical block number is stored in
370.Fa *bnp
371on return.
372.Fa vpp ,
373if
374.No non- Ns Dv NULL ,
375will be updated to point to the vnode of the block device of which
376.Fa vp
377is associated.
378.Fa runp ,
379if
380.No non- Ns Dv NULL ,
381will be updated to the number of contiguous disk blocks following
382.Fa *bnp .
383Upon success, zero is returned; otherwise, an appropriate error code is
384returned.
385.Pp
386.It Fn VOP_BWRITE bp
387Write a file system buffer to disk.
388Upon success, zero is returned; otherwise, an appropriate error code is
389returned.
390.Pp
391.It Fn VOP_CLOSE vp fflag cred p
392Close the file associated with the locked vnode
393.Fa vp
394with file flags
395.Fa fflag
396by the calling process
397.Fa p
398with credentials
399.Fa cred .
400This operation should be performed only when the file is no longer being
401used.
402Upon success, zero is returned; otherwise, an appropriate error code is
403returned.
404.Pp
405.It Fn VOP_CREATE dvp vpp cnp vap
406Create a new directory entry for a regular file in the directory
407.Fa dvp
408and return a locked, referenced vnode in
409.Fa vpp .
410The file name is in
411.Fa cnp
412and its permissions will be
413.Fa vap .
414.Pp
415.It Fn VOP_FSYNC vp cred waitfor p
416Flush any dirty buffers associated with
417.Fa vp
418to disk.
419The vnode is locked on entry and exit.
420.Fa waitfor
421can be set to
422.Dv MNT_WAIT
423to indicate that
424.Fn VOP_FSYNC
425should not return until all data is written.
426.Pp
427.It Fn VOP_GETATTR vp vap cred p
428.It Fn VOP_SETATTR vp vap cred p
429Access the vnode attributes
430.Fa vap
431of the vnode
432.Fa vp
433by the calling process
434.Fa p
435with credentials
436.Fa cred .
437.Fn VOP_SETATTR
438requires that
439.Fa vp
440be locked.
441A field value for any member of
442.Fa vap
443of
444.Dv VNOVAL
445represents that the information could not be obtained by
446.Fn VOP_GETATTR
447or should not be changed by
448.Fn VOP_SETATTR .
449Upon success of obtaining or changing the attributes, zero is returned;
450otherwise, an appropriate error code is returned.
451.Pp
452.It Fn VOP_INACTIVE vp p
453Notify the underlying file system that the locked vnode
454.Fa vp
455is no longer in use.
456The vnode will be unlocked upon return.
457.Fa p
458specifies the calling process.
459This may happen when the vnode reference count reaches zero or
460when the underlying file system has disappeared or has been forcibly
461unmounted.
462.Pp
463Typically, the underlying file system will write any buffers associated
464with
465.Fa vp
466to disk or delete the file entry, if need be.
467The underlying file system may not necessarily release any buffers
468associated with
469.Fa vp
470so that it can be immediately reactivated in case the file is used again.
471Upon success, zero is returned; otherwise, an appropriate error code is
472returned.
473.Pp
474.It Fn VOP_IOCTL vp command data fflag cred p
475Perform the control operation
476.Fa command
477with additional information
478.Fa data
479on the vnode
480.Fa vp ,
481normally associated with a device,
482with file flags
483.Fa fflag
484by the calling process
485.Fa p
486with credentials
487.Fa cred .
488Upon success, zero is returned; otherwise, an appropriate error code is
489returned.
490.Pp
491.It Fn VOP_ISLOCKED vp
492.It Fn VOP_LOCK vp flags p
493.It Fn VOP_UNLOCK vp flags p
494.Fn VOP_LOCK
495is used internally by
496.Xr vn_lock 9
497to lock a vnode.
498It should not be used by other file system code.
499.Fn VOP_UNLOCK
500unlocks a vnode.
501.Fa flags
502should be zero in most cases.
503.Fn VOP_ISLOCKED
504returns 1 if
505.Fa vp
506is locked and 0 if not.
507It should be used cautiously, as not all file systems implement locks
508effectively.
509Note the asymmetry between
510.Xr vn_lock 9
511and
512.Fn VOP_UNLOCK .
513.Pp
514.It Fn VOP_KQFILTER vp kn
515Register the
516.Xr knote 9
517filtering information
518.Fa kn
519for the vnode
520.Fa vp .
521Only filters for
522.Dv EVFILT_READ ,
523.Dv EVFILT_WRITE ,
524and
525.Dv EVFILT_VNODE
526will invoke this operation.
527Upon success, zero is returned; otherwise, a non-zero value is returned.
528.Pp
529.It Fn VOP_LINK dvp vp cnp
530Increase the link count for the vnode
531.Fa vp .
532A new entry with name
533.Fa cnp
534should be added to the directory
535.Fa dvp .
536.Fa dvp
537is locked on entry and unlocked on exit.
538.Pp
539.It Fn VOP_LOOKUP dvp vpp cnp
540Find the file corresponding to the name
541.Fa cnp
542in the directory
543.Fa dvp
544and return a vnode in
545.Fa vpp .
546.Fa dvp
547is locked on entry and exit, and
548.Fa vpp
549is locked upon a successful return.
550.Fa vpp
551will be
552.Dv NULL
553on error, and
554.Fa cnp->cn_flags
555will be set to
556.Dv PDIRUNLOCK
557if
558.Fa dvp
559has been unlocked for an unsuccessful return.
560.Pp
561.It Fn VOP_MKDIR dvp vpp cnp vap
562Create a new directory named by
563.Fa cnp
564with permissions
565.Fa vattr
566in the directory
567.Fa dvp .
568On success, the new vnode is returned locked in
569.Fa vpp .
570.Fa dvp
571must be locked on entry and is unlocked on exit.
572.Pp
573.It Fn VOP_MKNOD dvp vpp cnp vap
574Create a device special file with name
575.Fa cnp
576and attributes
577.Fa vap
578in the directory associated with the locked vnode
579.Fa dvp .
580.Fa dvp
581will be unlocked on return (see
582.Xr vput 9 ) .
583A pointer to the new, locked vnode will be returned in
584.Fa *vpp
585if
586.Fa vpp
587is not
588.Dv NULL .
589Upon success, zero is returned; otherwise, an appropriate error code is
590returned.
591.Pp
592.It Fn VOP_OPEN vp mode cred p
593Open the file associated with the vnode
594.Fa vp
595with the access modes
596.Fa mode
597by the calling process
598.Fa p
599with credentials
600.Fa cred .
601.Fa mode
602takes the flags described in
603.Xr open 2 .
604.Pp
605For some underlying file systems, access permissions for the file by the
606process are checked; for others, this is a no-op.
607In any case, this must be called before a process can access the file.
608Upon success, zero is returned; otherwise, an appropriate error code is
609returned.
610.Pp
611.It Fn VOP_PATHCONF vp name retval
612Obtain the value of the applicable
613.Tn POSIX
614configurable pathname variable (see
615.Xr pathconf 2 )
616specified by
617.Fa name
618from the locked vnode
619.Fa vp .
620The result is placed in
621.Fa *retval .
622Upon success, zero is returned; otherwise, an appropriate error code is
623returned.
624.Pp
625.It Fn VOP_POLL vp events p
626Determine whether the vnode
627.Fa vp
628is ready to perform the operations specified by
629.Fa events
630(see
631.Xr poll 2 )
632for the calling process
633.Fa p .
634The
635.Fn selrecord
636routine may be used to detect selection collisions for multiple
637processes sleeping on the same file, waiting for
638.Tn I/O
639to become possible, although all file systems currently assume that
640.Tn I/O
641is always possible.
642The return value specifies which operations from
643.Fa events
644were found to be ready, which may be performed without the need for
645blocking.
646.Pp
647.It Fn VOP_PRINT vp
648Print information about the vnode to the kernel message buffer.
649It is not used normally, but exists only for debugging purposes.
650.Pp
651.It Fn VOP_READ vp uio ioflag cred
652Copy data from the locked vnode
653.Fa vp
654to the buffers specified by
655.Fa uio
656with calling process credentials
657.Fa cred .
658.Pp
659.Fa ioflag
660may contain the following flags:
661.Pp
662.Bl -tag -width IO_APPEND -offset indent -compact
663.It Dv IO_NDELAY
664Non-blocking I/O.
665.It Dv IO_UNIT
666Do I/O as an atomic unit.
667.El
668.Pp
669Upon success, zero is returned; otherwise, an appropriate error code is
670returned.
671.Pp
672.It Fn VOP_READDIR vp uio cred eofflag
673Read the contents of the directory associated with the locked vnode
674.Fa vp ,
675usually via
676.Fn VOP_READ ,
677and convert its file-system-specific format to that expected by the
678.Xr getdents 2
679system call, storing the result into the buffers specified by
680.Fa uio .
681.Fa cred
682specifies the credentials of the calling process.
683.Fa *eofflag
684is set to a non-zero value on return once successful end-of-file for the
685directory contents has been reached.
686.Pp
687Upon success, zero is returned; otherwise, an appropriate error code is
688returned.
689.Pp
690.It Fn VOP_READLINK vp uio cred
691Read a symbolic link and return the target's name in
692.Fa uio .
693.Fa vp
694is locked on entry and exit and must be a symlink.
695.Pp
696.It Fn VOP_REALLOCBLKS vp buflist
697Called by the VFS write clustering code.
698It gives the file system an opportunity to rearrange the on-disk blocks
699for a file to reduce fragmentation.
700.Fa vp
701is the locked vnode for the file, and
702.Fa buflist
703is a cluster of the outstanding buffers about to be written.
704Currently, only FFS implements this call.
705.Pp
706.It Fn VOP_RECLAIM vp p
707Used by
708.Xr vclean 9
709so that the file system has an opportunity to free memory
710and perform any other cleanup activity related to
711.Fa vp .
712.Fa vp
713is unlocked on entry and exit.
714.Fn VOP_RECLAIM
715should not be used by generic code.
716.Pp
717.It Fn VOP_REMOVE dvp vp cnp
718Remove the link named
719.Fa cnp
720from the directory
721.Fa dvp .
722This file corresponds to the vnode
723.Fa vp .
724Both
725.Fa dvp
726and
727.Fa vp
728are locked on entry and unlocked on exit, and
729each has its reference count decremented by one.
730.Fn VOP_REMOVE
731does not delete the file from disk unless its link count
732becomes zero (for file systems which support multiple links).
733.Pp
734.It Fn VOP_RENAME fdvp fvp fcnp tdvp tvp tcnp
735Remove the link to the file with associated vnode
736.Fa fvp
737and name
738.Fa fcnp
739in the directory with associated vnode
740.Fa fdvp ,
741and create a new link to the file with name
742.Fa tcnp
743(and associated locked vnode
744.Fa tvp ,
745if the file already exists) residing in the directory with the
746associated locked vnode
747.Fa tdvp .
748.Fa fdvp ,
749.Fa fvp ,
750and
751.Fa tvp
752(if not
753.Dv NULL )
754will be released (see
755.Xr vrele 9 )
756and
757.Fa tdvp
758will have its reference count decremented (see
759.Xr vput 9 )
760on return.
761If not
762.Dv NULL ,
763.Fa tvp
764will be locked on return as well.
765Upon success, zero is returned; otherwise, an appropriate error code is
766returned.
767.Pp
768.It Fn VOP_REVOKE vp flags
769Used by the
770.Xr revoke 2
771system call to prevent any further access to a vnode.
772The vnode ops will be changed to those of deadfs, which returns only
773errors.
774.Ar vp
775must be unlocked.
776.Pp
777.It Fn VOP_RMDIR dvp vp cnp
778Remove the directory
779.Fa vp
780from the directory
781.Fa dvp .
782Both are locked on entry and unlocked on exit.
783The name of the directory for removal is additionally contained in
784.Fa cnp .
785.Pp
786.It Fn VOP_STRATEGY bp
787Call the appropriate strategy function for the device backing the
788buffer's vnode.
789.Pp
790.It Fn VOP_SYMLINK dvp vpp cnp vap target
791Create a symbolic link with name
792.Fa cnp
793in the directory
794.Fa dvp
795with mode
796.Fa vap .
797The link will point to
798.Fa target
799and a vnode for it is returned in
800.Fa vpp .
801The directory vnode is locked on entry and unlocked on exit.
802Note that unlike most VOP calls returning a vnode,
803.Fn VOP_SYMLINK
804does not lock or reference
805.Fa vpp .
806.Pp
807.It Fn VOP_WRITE vp uio ioflag cred
808Copy data from the buffers specified by
809.Fa uio
810to the locked vnode
811.Fa vp
812with calling process credentials
813.Fa cred .
814.Pp
815.Fa ioflag
816may contain the following flags:
817.Pp
818.Bl -tag -width IO_APPEND -offset indent -compact
819.It Dv IO_APPEND
820Perform write at the end of file.
821.It Dv IO_NDELAY
822Non-blocking I/O.
823.It Dv IO_SYNC
824Wait for I/O to complete.
825.It Dv IO_UNIT
826Do I/O as an atomic unit.
827.El
828.Pp
829Upon success, zero is returned; otherwise, an appropriate error code is
830returned.
831.El
832.Sh RETURN VALUES
833The
834.Nm VOP
835functions return 0 to indicate success and a non-zero error code
836to indicate failure.
837.Sh SEE ALSO
838.Xr errno 2 ,
839.Xr uio 9 ,
840.Xr vfs 9 ,
841.Xr vn_lock 9 ,
842.Xr vnode 9
843.Sh AUTHORS
844This man page was written by Ted Unangst for
845.Ox .
846.Sh BUGS
847The locking discipline is too complex.
848Refer to
849.Xr vn_lock 9 .
850