diff --git a/lib/libc/sys/copy_file_range.2.sav b/lib/libc/sys/copy_file_range.2 --- a/lib/libc/sys/copy_file_range.2.sav +++ b/lib/libc/sys/copy_file_range.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD: head/lib/libc/sys/copy_file_range.2 359465 2020-03-30 21:44:00Z jhb $ .\" -.Dd March 30, 2020 +.Dd January 2, 2021 .Dt COPY_FILE_RANGE 2 .Os .Sh NAME @@ -133,6 +133,15 @@ .Fn copy_file_range should be used in a loop until copying of the desired byte range has been completed. +For performance reasons, the +.Fa len +argument should be set to the largest value possible. +For copying to EOF on the input file, the value may be SSIZE_MAX. +Doing so reduces the number of system calls, along with +associated SEEK_HOLE, SEEK_DATA operations done either by +.Xr lseek 2 +or internally by +.Fn copy_file_range . If an error has occurred, a \-1 is returned and the error code is placed in the global variable .Va errno .