*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> VOP_CLOSE (9)              
Title
Content
Arch
Section
 

VOP_OPEN(9)

Contents


NAME    [Toc]    [Back]

     VOP_OPEN, VOP_CLOSE -- open or close a file

SYNOPSIS    [Toc]    [Back]

     #include <sys/param.h>
     #include <sys/vnode.h>

     int
     VOP_OPEN(struct vnode *vp, int mode, struct ucred *cred,
	 struct thread *td);

     int
     VOP_CLOSE(struct vnode *vp, int mode, struct ucred *cred,
	 struct thread *td);

DESCRIPTION    [Toc]    [Back]

     The VOP_OPEN() entry point is called before a file is accessed by a
     process and the VOP_CLOSE() entry point is called after a file is finished
 with by the process.

     The arguments are:

     vp    the vnode of the file

     mode  the access mode required by the calling process

     td    the thread which is accessing the file

     The access mode is a set of flags, including FREAD, FWRITE, O_NONBLOCK,
     O_APPEND.

LOCKS    [Toc]    [Back]

     VOP_OPEN() expects vp to be locked on entry and will leave it locked on
     return.

     VOP_CLOSE() expects at least a reference to be associated with the vnode
     and does not care whether the vnode is locked or not.  The lock and reference
 state is left unchanged on return.	Note that vn_close expects an
     unlocked, referenced vnode and will dereference the vnode prior to
     returning.

RETURN VALUES    [Toc]    [Back]

     Zero is returned on success, otherwise an error code is returned.

PSEUDOCODE    [Toc]    [Back]

     int
     vop_open(struct vnode *vp, int mode, struct ucred *cred, struct thread *td)
     {
	 /*
	  * Most file systems don't do much here.
	  */
	 return 0;
     }

SEE ALSO    [Toc]    [Back]

      
      
     vnode(9), VOP_LOOKUP(9)

AUTHORS    [Toc]    [Back]

     This man page was written by Doug Rabson.


FreeBSD 5.2.1			 July 24, 1996			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
close IRIX Close an open file
endnetent Tru64 Open, rewind, or close the networks file
endnetent_r Tru64 Open, rewind, or close the networks file
setnetent_r Tru64 Open, rewind, or close the networks file
setnetent Tru64 Open, rewind, or close the networks file
mdClosePort IRIX open and close MDports
fcloseall Linux close all open streams
ufs_disk_write FreeBSD open and close userland UFS disks
ufs_disk_close FreeBSD open and close userland UFS disks
ufs_disk_fillout FreeBSD open and close userland UFS disks
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service