Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
VOP_OPEN(9)	       FreeBSD Kernel Developer's Manual	   VOP_OPEN(9)

NAME
     VOP_OPEN, VOP_CLOSE -- open or close a file

SYNOPSIS
     #include <sys/vnode.h>

     int
     VOP_OPEN(struct vnode *vp,	int mode, struct ucred *cred, struct proc *p);

     int
     VOP_CLOSE(struct vnode *vp, int mode, struct ucred	*cred,
	 struct	proc *p);

DESCRIPTION
     The VOP_OPEN(9) entry point is called before a file is accessed by	a
     process and the VOP_CLOSE(9) entry	point is called	after a	file is	fin-
     ished with	by the process.

     The arguments are:

     vp	   the vnode of	the file

     mode  the access mode required by the calling process

     p	   the process which is	accessing the file

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

LOCKS
     The vnode vp should be locked on entry and	will still be locked on	exit
     for VOP_OPEN(9) and unlocked on entry and exit for	VOP_CLOSE(9).

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

PSEUDOCODE
     int
     vop_open(struct vnode *vp,	int mode, struct ucred *cred, struct proc *p)
     {
	 /*
	  * Most filesystems don't do much here.
	  */
	 return	0;
     }

SEE ALSO
     vnode(9), VOP_LOOKUP(9)

AUTHORS
     This man page was written by Doug Rabson.

FreeBSD	11.1			 July 24, 1996			  FreeBSD 11.1

NAME | SYNOPSIS | DESCRIPTION | LOCKS | RETURN VALUES | PSEUDOCODE | SEE ALSO | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=VOP_OPEN&sektion=9&manpath=FreeBSD+2.2.1-RELEASE>

home | help