int
vn_closefile(
file_t *fp
)
int
vn_fcntl(
file_t *fp
, u_int com
, void *data
)
int
vn_ioctl(
file_t *fp
, u_long com
, void *data
)
int
vn_read(
file_t *fp
, off_t *offset
, struct uio *uio
, kauth_cred_t cred
, int flags
)
int
vn_poll(
file_t *fp
, int events
)
int
vn_statfile(
file_t *fp
, struct stat *sb
)
int
vn_write(
file_t *fp
, off_t *offset
, struct uio *uio
, kauth_cred_t cred
, int flags
)
fp
, l
)
fp
and
l
is the calling lwp.
vn_closefile(
)
simply calls
vn_close(9)
with the appropriate arguments.
fp
, com
, data
, l
)
fp
.
The argument
l
is the calling lwp.
vn_fcntl(
)
simply locks the vnode and invokes the vnode operation
VOP_FCNTL(9)
with the command
com
and buffer
data
.
The vnode is unlocked on return.
If the operation is successful zero is returned, otherwise an
appropriate error is returned.
fp
, com
, data
, l
)
fp
.
The argument
l
is the calling lwp
vn_ioctl(
)
simply locks the vnode and invokes the vnode operation
VOP_IOCTL(9)
with the command
com
and buffer
data
.
The vnode is unlocked on return.
If the operation is successful zero is returned, otherwise an
appropriate error is returned.
fp
, offset
, uio
, cred
, flags
)
fp
is the file structure, The argument
offset
is the offset into the file.
The argument
uio
is the uio structure describing the memory to read into.
The caller's credentials are specified in
cred
.
The
flags
argument can define FOF_UPDATE_OFFSET to update the read position in
the file.
If the operation is successful zero is returned, otherwise an
appropriate error is returned.
fp
, events
, l
)
)
simply calls
VOP_POLL(9)
with the events
events
and the calling lwp
l
.
The function returns a bitmask of available events.
fp
, sb
, l
)
fp
and
sb
is the buffer to return the stat information.
The argument
l
is the calling lwp.
vn_statfile(
)
basically calls the vnode operation
VOP_GETATTR(9)
and transfer the contents of a vattr structure into a struct stat.
If the operation is successful zero is returned, otherwise an
appropriate error code is returned.
fp
, offset
, uio
, cred
, flags
)
fp
is the file structure, The argument
offset
is the offset into the file.
The argument
uio
is the uio structure describing the memory to read from.
The caller's credentials are specified in
cred
.
The
flags
argument can define FOF_UPDATE_OFFSET to update the read position in
the file.
If the operation is successful zero is returned, otherwise an
appropriate error is returned.
/usr/src
.
The high-level convenience functions are implemented within the file
sys/kern/vfs_vnops.c
.