aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libsys')
-rw-r--r--lib/libsys/copy_file_range.235
-rw-r--r--lib/libsys/stat.25
2 files changed, 35 insertions, 5 deletions
diff --git a/lib/libsys/copy_file_range.2 b/lib/libsys/copy_file_range.2
index bcd9170842d5..829a5a5d3c13 100644
--- a/lib/libsys/copy_file_range.2
+++ b/lib/libsys/copy_file_range.2
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 28, 2023
+.Dd August 16, 2025
.Dt COPY_FILE_RANGE 2
.Os
.Sh NAME
@@ -74,6 +74,7 @@ argument must be opened for reading and the
.Fa outfd
argument must be opened for writing, but not
.Dv O_APPEND .
+.Pp
If
.Fa inoffp
or
@@ -101,9 +102,29 @@ respectively will be used/updated and the file offset for
or
.Fa outfd
respectively will not be affected.
-The
+.Pp
+The only
+.Fa flags
+argument currently defined is
+.Dv COPY_FILE_RANGE_CLONE .
+When this flag is set,
+.Fn copy_file_range
+will return
+.Er EOPNOTSUPP
+if the copy cannot be done via
+block cloning.
+When
.Fa flags
-argument must be 0.
+is 0, a file system may do the copy via block cloning
+or by data copying.
+Block cloning is only possible when the offsets (plus
+.Fa len
+if not to EOF on the input file) are block
+aligned.
+The correct block alignment can normally be acquired via the
+.Dv _PC_CLONE_BLKSIZE
+query for
+.Xr pathconf 2 .
.Pp
This system call attempts to maintain holes in the output file for
the byte range being copied.
@@ -203,9 +224,15 @@ refers to a directory.
File system that stores
.Fa outfd
is full.
+.It Bq Er EOPNOTSUPP
+Cannot do the copy via block cloning and the
+.Dv COPY_FILE_RANGE_CLONE
+.Fa flags
+argument is specified.
.El
.Sh SEE ALSO
-.Xr lseek 2
+.Xr lseek 2 ,
+.Xr pathconf 2
.Sh STANDARDS
The
.Fn copy_file_range
diff --git a/lib/libsys/stat.2 b/lib/libsys/stat.2
index bd9005710147..8107740bd901 100644
--- a/lib/libsys/stat.2
+++ b/lib/libsys/stat.2
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 30, 2021
+.Dd August 17, 2025
.Dt STAT 2
.Os
.Sh NAME
@@ -169,6 +169,9 @@ Flags enabled for the file.
See
.Xr chflags 2
for the list of flags and their description.
+.It Va st_rdev
+Numeric ID of the device referenced by the file, if the file is a
+character or block special; otherwise unspecified.
.El
.Pp
The