12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VNSUBR (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> VNSUBR (9)vn_readdir(fp , buf , segflg , count , done , l , cookies , ncookies)Common code for reading the contents of a directory. The argument fp is the file structure, bufis the buffer for placing the struct dirent structures. The arguments cookies and ncookiesspecify the addresses for the list and number of directory seek cookies generated for NFS. Bothcookies and ncookies should be NULL is they aren’t required to be returned byvn_readdir(). If the operation is successful zero is returned, otherwise an appropriate errorcode is returned.vn_stat(vp , sb , l)Common code for a vnode stat operation. The vnode is specified by the argument vp, and sb isthe buffer to return the stat information. The argument l is the calling lwp. vn_stat() basicallycalls the vnode operation VOP_GETATTR(9) and transfers the contents of a vattr structureinto a struct stat. If the operation is successful zero is returned, otherwise an appropriate errorcode is returned.vn_writechk(vp)Common code to check for write permission on the vnode vp. A vnode is read-only if it is in useas a process’s text image. If the vnode is read-only ETEXTBSY is returned, otherwise zero isreturned to indicate that the vnode can be written to.ERRORS[EBUSY]The LK_NOWAIT flag was set and vn_lock() would have slept.[ENOENT] The vnode has been reclaimed and is dead. This error is only returned if theLK_RETRY flag is not passed to vn_lock().[ETXTBSY]Cannot write to a vnode since is a process’s text image.CODE REFERENCESThis section describes places within the <strong>NetBSD</strong> source tree where actual code implementing or using thevnode framework can be found. All pathnames are relative to /usr/src.The high-level convenience functions are implemented within the files sys/kern/vfs_vnops.c andsys/sys/vnode.h.SEE ALSOfile(9), intro(9), lock(9), namei(9), vattr(9), vfs(9), vnode(9), vnodeops(9)<strong>NetBSD</strong> 3.0 April 9, 2008 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!