Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_descrip.c
Show First 20 Lines • Show All 3,090 Lines • ▼ Show 20 Lines | sys_flock(struct thread *td, struct flock_args *uap) | ||||
struct file *fp; | struct file *fp; | ||||
struct vnode *vp; | struct vnode *vp; | ||||
struct flock lf; | struct flock lf; | ||||
int error; | int error; | ||||
error = fget(td, uap->fd, &cap_flock_rights, &fp); | error = fget(td, uap->fd, &cap_flock_rights, &fp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (fp->f_type != DTYPE_VNODE) { | if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_FIFO) { | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
} | } | ||||
vp = fp->f_vnode; | vp = fp->f_vnode; | ||||
lf.l_whence = SEEK_SET; | lf.l_whence = SEEK_SET; | ||||
lf.l_start = 0; | lf.l_start = 0; | ||||
lf.l_len = 0; | lf.l_len = 0; | ||||
▲ Show 20 Lines • Show All 1,413 Lines • Show Last 20 Lines |