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

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

VOP_REMOVE(9)

Contents


NAME    [Toc]    [Back]

     VOP_REMOVE, VOP_RMDIR -- remove a file or directory

SYNOPSIS    [Toc]    [Back]

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

     int
     VOP_REMOVE(struct vnode *dvp, struct vnode *vp,
	 struct componentname *cnp);

     int
     VOP_RMDIR(struct vnode *dvp, struct vnode *vp,
	 struct componentname *cnp);

DESCRIPTION    [Toc]    [Back]

     These entry points remove files and directories respectively.

     The arguments are:

     dvp  the vnode of the directory

     vp   the vnode of the file to be removed

     cnp  pathname information about the file

LOCKS    [Toc]    [Back]

     Both dvp and vp should be locked on entry and remain locked on return.

RETURN VALUES    [Toc]    [Back]

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

PSEUDOCODE    [Toc]    [Back]

     int
     vop_remove(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
     {
	 int error = 0;

	 if (vp is immutable) {
	     error = EPERM;
	     goto out;
	 }

	 /*
	  * Remove name cnp->cn_nameptr from directory and update link count
	  * of vp.
	  */
	 ...;

	 /*
	  * Careful about trying to remove ".".  XXX this should be handled
	  * higher up.
	  */
	 if (dvp == vp)
	     vrele(vp);
	 else
	     vput(vp);
	 vput(dvp);

	 return error;
     }

ERRORS    [Toc]    [Back]

     [EPERM]		The file is immutable.

     [ENOTEMPTY]	An attempt was made to remove a directory which is not
			empty.

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
rmdir HP-UX remove a directory file
rmdir Tru64 Remove a directory file
rmdir OpenBSD remove a directory file
rmdir FreeBSD remove a directory file
rmdir NetBSD remove a directory file
unlink HP-UX remove directory entry; delete file
efi_rmdir HP-UX remove an EFI directory
rmdir IRIX remove a directory
remove NetBSD remove directory entry
rm FreeBSD remove directory entries
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service