VOP_REMOVE(9)
π VOP_REMOVE(9) π
okay bestie, welcome to the Kernel Developer's Manual β¨ this one's about VOP_REMOVE and VOP_RMDIR β the vnode operations that yeet files and directories out of existence ποΈπ
πΈ NAME πΈ
VOP_REMOVE, VOP_RMDIR β remove a file or directory
β¨ SYNOPSIS β¨
#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 π¦
So these two entry points are the moment of truth: they remove files and directories, respectively. VOP_REMOVE handles the files, VOP_RMDIR handles the dirs, and honestly? iconic behaviour π
The arguments are:
dvpβ the vnode of the directory π (yes, the directory that's holding the thing you're deleting, she's the main character here)vpβ the vnode of the file to be removed πΈcnpβ pathname information about the file, iykyk π
π LOCKS π
Bothdvpandvpshould be locked on entry and remain locked on return. no cap. don't be out here unlocking mid-operation, that's not the vibe π
π RETURN VALUES π
Zero is returned on success π otherwise an error code is returned π
π ERRORS π
[EPERM]β The file is immutable. she cannot be moved, she cannot be removed, she said no periodt β[ENOTEMPTY]β An attempt was made to remove a directory which is not empty. like bestie you gotta empty her out first, you can't just rmdir a whole folder full of stuff π
π SEE ALSO π
π«Ά AUTHORS π«Ά
This manual page was written by Doug Rabson. thank you king π
and that's the whole page bestie, slay β¨ this lil guide came from the Debian release, dated July 24, 1996 π β yep, a vintage queen, and she's still out here handling VOP_REMOVE(9) business like it's nothing π
πΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms