GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
VOP_COPY_FILE_RANGE(9) FreeBSD Kernel Developer's Manual VOP_COPY_FILE_RANGE(9)

VOP_COPY_FILE_RANGE
copy a byte range from one file to another or within one file in a single file system

#include <sys/param.h>
#include <sys/vnode.h>

int
VOP_COPY_FILE_RANGE(struct vnode *invp, off_t *inoff, struct vnode *outvp, off_t *outoff, size_t *len, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td);

This entry point copies a byte range from one regular file to another or within one file in a single file system. invp and outvp can refer to the same file. For this case, the byte ranges defined by *inoff, *outoff and *len will not overlap.

The arguments are:

invp
The vnode of the input file.
inoff
A pointer to the file offset for the input file.
outvp
The vnode of the output file.
outoff
A pointer to the file offset for the output file.
len
A pointer to the byte count for the copy.
flags
Flags, should be set to 0 for now.
incred
The credentials used to read invp.
outcred
The credentials used to write outvp.
fsize_td
The thread pointer to be passed to vn_rlimit_fsize(). This will be NULL for a server thread without limits, such as for the NFS server or curthread otherwise.

On entry and on return, the inoff and outoff arguments point to the locations of the file offsets. These file offsets should be updated by the number of bytes copied. The len argument points to the location that stores the number of bytes to be copied. Upon a successful return len will be updated to the number of bytes actually copied. Normally, this will be the number of bytes requested to be copied, however a copy of fewer bytes than requested is permitted. This does not necessarily indicate that the copy reached EOF on the input file. However, if the value pointed to by the len argument is zero upon a successful return, it indicates that the offset pointed to by inoff is at or beyond EOF on the input file.

The vnode are unlocked on entry and must be unlocked on return. The byte ranges for both invp and outvp should be range locked when this call is done.

Zero is returned on success, otherwise an error code is returned.

[]
If the copy exceeds the process's file size limit or the maximum file size for the file system invp and outvp reside on.
[]
A signal interrupted the VOP call before it could be completed.
[]
An I/O error occurred while reading/writing the files.
[]
Corrupted data was detected while reading/writing the files.
[]
The file system is full.

vn_rdwr(9), vnode(9)
March 30, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 9 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.