MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _fgetvp

Function _fgetvp

freebsd/kern/kern_descrip.c:3504–3524  ·  view source on GitHub ↗

* Like fget() but loads the underlying vnode, or returns an error if the * descriptor does not represent a vnode. Note that pipes use vnodes but * never have VM objects. The returned vnode will be vref()'d. * * XXX: what about the unused flags ? */

Source from the content-addressed store, hash-verified

3502 * XXX: what about the unused flags ?
3503 */
3504static __inline int
3505_fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp,
3506 struct vnode **vpp)
3507{
3508 struct file *fp;
3509 int error;
3510
3511 *vpp = NULL;
3512 error = _fget(td, fd, &fp, flags, needrightsp);
3513 if (error != 0)
3514 return (error);
3515 if (fp->f_vnode == NULL) {
3516 error = EINVAL;
3517 } else {
3518 *vpp = fp->f_vnode;
3519 vrefact(*vpp);
3520 }
3521 fdrop(fp, td);
3522
3523 return (error);
3524}
3525
3526int
3527fgetvp(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp)

Callers 4

fgetvpFunction · 0.85
fgetvp_readFunction · 0.85
fgetvp_execFunction · 0.85
fgetvp_writeFunction · 0.85

Calls 2

_fgetFunction · 0.85
vrefactFunction · 0.70

Tested by

no test coverage detected