summaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-10-30 20:02:25 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-10-30 20:02:25 +0000
commit23934d70ca697240f8d6859ff7ec2b39df724b81 (patch)
treeadeea9894e17d13cf8016e876d4346c580bfe896 /share/man
parentb310e30cd587edf4bccf03a2b72882c31c8d2c3f (diff)
Man page for VOP_GETATTR/VOP_SETATTR vnode operations.
Usual tweaking by jaredy@ and jmc@, thanks.
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/Makefile10
-rw-r--r--share/man/man9/VOP_GETATTR.9108
2 files changed, 113 insertions, 5 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 9305bbb3e6a..ba0113dc284 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.104 2005/09/30 18:48:58 jmc Exp $
+# $OpenBSD: Makefile,v 1.105 2005/10/30 20:02:24 pedro Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -25,8 +25,8 @@ MAN= altq.9 audio.9 autoconf.9 boot.9 buffercache.9 bus_dma.9 bus_space.9 \
tc_init.9 time.9 timeout.9 tvtohz.9 uiomove.9 uvm.9 vfs.9 vfs_cache.9 \
vaccess.9 vclean.9 vcount.9 vdevgone.9 vfinddev.9 vflush.9 \
vflushbuf.9 vget.9 vgone.9 vhold.9 vinvalbuf.9 vnode.9 vnsubr.9 \
- VOP_LOOKUP.9 vput.9 vrecycle.9 vref.9 vrele.9 vwaitforio.9 vwakeup.9 \
- wdog_register.9
+ VOP_GETATTR.9 VOP_LOOKUP.9 vput.9 vrecycle.9 vref.9 vrele.9 \
+ vwaitforio.9 vwakeup.9 wdog_register.9
MLINKS+=autoconf.9 config_init.9 autoconf.9 config_search.9 \
autoconf.9 config_rootsearch.9 autoconf.9 config_found_sm.9 \
@@ -297,7 +297,6 @@ MLINKS+=VOP_LOOKUP.9 VOP_ABORTOP.9 VOP_LOOKUP.9 VOP_ACCESS.9 \
VOP_LOOKUP.9 VOP_ADVLOCK.9 VOP_LOOKUP.9 VOP_BMAP.9 \
VOP_LOOKUP.9 VOP_BWRITE.9 VOP_LOOKUP.9 VOP_CLOSE.9 \
VOP_LOOKUP.9 VOP_CREATE.9 VOP_LOOKUP.9 VOP_FSYNC.9 \
- VOP_LOOKUP.9 VOP_GETATTR.9 \
VOP_LOOKUP.9 VOP_INACTIVE.9 VOP_LOOKUP.9 VOP_IOCTL.9 \
VOP_LOOKUP.9 VOP_ISLOCKED.9 VOP_LOOKUP.9 VOP_KQFILTER.9 \
VOP_LOOKUP.9 VOP_LINK.9 \
@@ -309,8 +308,9 @@ MLINKS+=VOP_LOOKUP.9 VOP_ABORTOP.9 VOP_LOOKUP.9 VOP_ACCESS.9 \
VOP_LOOKUP.9 VOP_REALLOCBLKS.9 VOP_LOOKUP.9 VOP_RECLAIM.9 \
VOP_LOOKUP.9 VOP_REMOVE.9 VOP_LOOKUP.9 VOP_RENAME.9 \
VOP_LOOKUP.9 VOP_REVOKE.9 VOP_LOOKUP.9 VOP_RMDIR.9 \
- VOP_LOOKUP.9 VOP_SETATTR.9 \
VOP_LOOKUP.9 VOP_STRATEGY.9 VOP_LOOKUP.9 VOP_SYMLINK.9 \
VOP_LOOKUP.9 VOP_UNLOCK.9 VOP_LOOKUP.9 VOP_WRITE.9
+MLINKS+= VOP_GETATTR.9 VOP_SETATTR.9
+
.include <bsd.prog.mk>
diff --git a/share/man/man9/VOP_GETATTR.9 b/share/man/man9/VOP_GETATTR.9
new file mode 100644
index 00000000000..e25e9393f14
--- /dev/null
+++ b/share/man/man9/VOP_GETATTR.9
@@ -0,0 +1,108 @@
+.\" $OpenBSD: VOP_GETATTR.9,v 1.1 2005/10/30 20:02:24 pedro Exp $
+.\"
+.\" Copyright (c) 2005 Pedro Martelletto <pedro@openbsd.org>
+.\" All rights reserved.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd October 29, 2005
+.Dt VOP_GETATTR 9
+.Os
+.Sh NAME
+.Nm VOP_GETATTR ,
+.Nm VOP_SETATTR
+.Nd get or set vnode attributes
+.Sh SYNOPSIS
+.Fd #include <sys/vnode.h>
+.Ft int
+.Fo VOP_GETATTR
+.Fa "struct vnode *vp"
+.Fa "struct vattr *vap"
+.Fa "struct ucred *cred"
+.Fa "struct proc *p"
+.Fc
+.Ft int
+.Fo VOP_SETATTR
+.Fa "struct vnode *vp"
+.Fa "struct vattr *vap"
+.Fa "struct ucred *cred"
+.Fa "struct proc *p"
+.Fc
+.Sh DESCRIPTION
+The
+.Nm VOP_GETATTR
+and
+.Nm VOP_SETATTR
+routines implement a generic way of representing, retrieving, and setting many
+vnode attributes such as size, number of references, access mode, and last
+modified time.
+All attributes are held in the
+.Fa vattr
+structure described below.
+.Bd -literal
+struct vattr {
+ enum vtype va_type; /* vnode type */
+ mode_t va_mode; /* files access mode and type */
+ nlink_t va_nlink; /* number of references */
+ uid_t va_uid; /* owner user id */
+ gid_t va_gid; /* owner group id */
+ long va_fsid; /* file system id */
+ long va_fileid; /* file id */
+ u_quad_t va_size; /* file size in bytes */
+ long va_blocksize; /* blocksize preferred for i/o */
+ struct timespec va_atime; /* time of last access */
+ struct timespec va_mtime; /* time of last modification */
+ struct timespec va_ctime; /* time file changed */
+ u_long va_gen; /* generation number of file */
+ u_long va_flags; /* flags defined for file */
+ dev_t va_rdev; /* device the vnode represents */
+ u_quad_t va_bytes; /* bytes of held disk space */
+ u_quad_t va_filerev; /* file modification number */
+ u_int va_vaflags; /* operations flags */
+ long va_spare; /* remain quad aligned */
+};
+.Ed
+.Sh IMPLEMENTATION NOTES
+Depending on the specific filesystem implementation, some values may not be
+available for modification and/or retrieval.
+In these cases, the corresponding fields in the
+.Fa vattr
+structure should be set to
+.Dv VNOVAL .
+.Pp
+Upon return from a
+.Fn VOP_GETATTR
+call made on a directory, the
+.Fa va_nlink
+field should contain the number of entries in the directory, if possible,
+or 1 otherwise.
+.Sh RETURN VALUES
+The
+.Fn VOP_GETATTR
+and
+.Fn VOP_SETATTR
+functions return 0 to indicate success and a non-zero error code
+to indicate failure.
+See
+.Xr errno 2
+for more information.
+.Sh SEE ALSO
+.Xr errno 2 ,
+.Xr vfs 9 ,
+.Xr vn_stat 9 ,
+.Xr vnode 9
+.Sh AUTHORS
+This man page was written by
+.An Pedro Martelletto
+for
+.Ox .