| Main index | Section 9 | Options |
#include <sys/param.h>
#include <sys/systm.h>
#include <vm/vm_param.h>extern const void *zero_region;
/*
* This function writes zeroes to the vnode at offset 0
* with ZERO_REGION_SIZE length.
*/
static int
write_example(struct vnode *vp)
{
struct thread *td;
struct iovec aiov;
struct uio auio;
int error;
td = curthread;
aiov.iov_base = __DECONST(void *, zero_region);
aiov.iov_len = ZERO_REGION_SIZE;
auio.uio_iov = &aiov;
auio.uio_iovcnt = 1;
auio.uio_offset = 0;
auio.uio_resid = ZERO_REGION_SIZE;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_WRITE;
auio.uio_td = td;
error = VOP_WRITE(vp, &auio, 0, td->td_ucred);
return (error);
}
| ZERO_REGION (9) | March 2, 2021 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
