diff --git a/dev/search-index.js b/dev/search-index.js
index 48114f64f..ad9ac4e60 100644
--- a/dev/search-index.js
+++ b/dev/search-index.js
@@ -111,7 +111,7 @@ var searchIndex = JSON.parse('{\
"uu_chroot":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_chroot",""],"d":["",""],"i":[0,0],"f":[[[],["command",6]],[[],["i32",0]]],"p":[]},\
"uu_cksum":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_cksum",""],"d":["",""],"i":[0,0],"f":[[[],["command",6]],[[],["i32",0]]],"p":[]},\
"uu_comm":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_comm",""],"d":["",""],"i":[0,0],"f":[[[],["command",6]],[[],["i32",0]]],"p":[]},\
-"uu_cp":{"doc":"","t":[13,13,4,13,13,13,4,13,13,4,6,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,3,4,13,4,13,13,6,6,13,13,13,13,6,6,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,5,12,12,12,12,12,12,12,12,12,12,12,12],"n":["Always","AttrOnly","Attribute","Auto","Backup","Clobber","ClobberMode","Context","Copy","CopyMode","CopyResult","Directory","Error","Error","File","Force","Interactive","InvalidArgument","IoErr","IoErrContext","Link","Links","Mode","Never","NoClobber","NotAllFilesCopied","NotImplemented","Options","OverwriteMode","Ownership","ReflinkMode","RemoveDestination","Skipped","Source","SourceSlice","Sparse","Standard","StripPrefixError","SymLink","Target","TargetSlice","TargetType","Timestamps","Update","WalkDirErr","Xattr","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","code","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","ficlone","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_str","into","into","into","into","into","into","into","into","localize_to_target","ne","partial_cmp","path_has_prefix","paths_refer_to_same_file","source","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","uu_app","uumain","verify_target_type","0","0","0","0","0","0","0","0","0","1","0","0"],"q":["uu_cp","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uu_cp::Error","","","","","","","","","","uu_cp::OverwriteMode",""],"d":["","","","","Invalid arguments to backup","Default Always overwrite existing files","Specifies whether when overwrite files","","","","","","","General copy error","","","Prompt before overwriting a file","Result of a skipped file","Simple io::Error wrapper","Wrapper for io::Error with path context","","","","","Never overwrite a file","Represents the state when a non-fatal error has occurred …","All standard options are included as an an implementation …","Re-usable, extensible copy options","Specifies whether when overwrite files","","Possible arguments for --reflink.","","Result of a skipped file","","","","","Simple std::path::StripPrefixError wrapper","","","","Specifies the expected file type of copy target","","","Simple walkdir::Error wrapper","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Remove the root prefix from source and prefix it with …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Generate an error message if target is not the correct …","","","","","","","","","","","",""],"i":[1,2,0,1,3,4,0,5,2,0,0,6,0,3,6,7,4,3,3,3,2,5,5,1,4,3,3,0,0,5,0,7,3,0,0,2,7,3,2,0,0,0,5,2,3,5,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,7,4,1,5,7,4,1,5,5,3,7,4,1,5,7,4,1,5,0,3,3,5,6,2,8,3,3,3,3,3,3,3,3,7,4,1,5,5,6,2,8,3,7,4,1,5,0,4,5,0,0,3,7,4,1,5,3,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,0,0,0,9,10,11,12,13,14,15,16,17,10,18,19],"f":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["clobbermode",4]],[[["",0]],["overwritemode",4]],[[["",0]],["reflinkmode",4]],[[["",0]],["attribute",4]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["attribute",4]],["ordering",4]],[[["",0]],["i32",0]],[[["",0],["clobbermode",4]],["bool",0]],[[["",0],["overwritemode",4]],["bool",0]],[[["",0],["reflinkmode",4]],["bool",0]],[[["",0],["attribute",4]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["c_int",6]],["c_int",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[]],[[]],[[]],[[["context",3,[["str",0],["error",3]]]],["error",4]],[[["stripprefixerror",3]],["error",4]],[[]],[[["context",3,[["string",3],["error",3]]]],["error",4]],[[["error",3]],["error",4]],[[["string",3]],["error",4]],[[["str",0]],["error",4]],[[["error",3]],["error",4]],[[]],[[]],[[]],[[]],[[["str",0]],["copyresult",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["path",3],["path",3],["path",3]],["copyresult",6,[["pathbuf",3]]]],[[["",0],["overwritemode",4]],["bool",0]],[[["",0],["attribute",4]],["option",4,[["ordering",4]]]],[[["path",3],["path",3]],["result",6,[["bool",0]]]],[[["path",3],["path",3]],["result",6,[["bool",0]]]],[[["",0]],["option",4,[["error",8]]]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[],["command",6]],[[],["i32",0]],[[["path",3],["targettype",4]],["copyresult",6]],null,null,null,null,null,null,null,null,null,null,null,null],"p":[[4,"ReflinkMode"],[4,"CopyMode"],[4,"Error"],[4,"OverwriteMode"],[4,"Attribute"],[4,"TargetType"],[4,"ClobberMode"],[3,"Options"],[13,"IoErr"],[13,"IoErrContext"],[13,"Error"],[13,"WalkDirErr"],[13,"StripPrefixError"],[13,"Skipped"],[13,"InvalidArgument"],[13,"NotImplemented"],[13,"Backup"],[13,"Clobber"],[13,"Interactive"]]},\
+"uu_cp":{"doc":"","t":[13,13,4,13,13,13,4,13,13,4,6,13,4,13,13,13,13,13,13,13,13,13,13,13,13,13,13,3,4,13,4,13,13,6,6,13,13,13,13,6,6,4,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,5,12,12,12,12,12,12,12,12,12,12,12,12],"n":["Always","AttrOnly","Attribute","Auto","Backup","Clobber","ClobberMode","Context","Copy","CopyMode","CopyResult","Directory","Error","Error","File","Force","Interactive","InvalidArgument","IoErr","IoErrContext","Link","Links","Mode","Never","NoClobber","NotAllFilesCopied","NotImplemented","Options","OverwriteMode","Ownership","ReflinkMode","RemoveDestination","Skipped","Source","SourceSlice","Sparse","Standard","StripPrefixError","SymLink","Target","TargetSlice","TargetType","Timestamps","Update","WalkDirErr","Xattr","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","code","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_str","into","into","into","into","into","into","into","into","localize_to_target","ne","partial_cmp","path_has_prefix","paths_refer_to_same_file","source","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","uu_app","uumain","verify_target_type","0","0","0","0","0","0","0","0","0","1","0","0"],"q":["uu_cp","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uu_cp::Error","","","","","","","","","","uu_cp::OverwriteMode",""],"d":["","","","","Invalid arguments to backup","Default Always overwrite existing files","Specifies whether when overwrite files","","","","","","","General copy error","","","Prompt before overwriting a file","Result of a skipped file","Simple io::Error wrapper","Wrapper for io::Error with path context","","","","","Never overwrite a file","Represents the state when a non-fatal error has occurred …","All standard options are included as an an implementation …","Re-usable, extensible copy options","Specifies whether when overwrite files","","Possible arguments for --reflink.","","Result of a skipped file","","","","","Simple std::path::StripPrefixError wrapper","","","","Specifies the expected file type of copy target","","","Simple walkdir::Error wrapper","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Remove the root prefix from source and prefix it with …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Generate an error message if target is not the correct …","","","","","","","","","","","",""],"i":[1,2,0,1,3,4,0,5,2,0,0,6,0,3,6,7,4,3,3,3,2,5,5,1,4,3,3,0,0,5,0,7,3,0,0,2,7,3,2,0,0,0,5,2,3,5,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,7,4,1,5,7,4,1,5,5,3,7,4,1,5,7,4,1,5,3,3,5,6,2,8,3,3,3,3,3,3,3,3,7,4,1,5,5,6,2,8,3,7,4,1,5,0,4,5,0,0,3,7,4,1,5,3,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,6,2,8,3,7,4,1,5,0,0,0,9,10,11,12,13,14,15,16,17,10,18,19],"f":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["clobbermode",4]],[[["",0]],["overwritemode",4]],[[["",0]],["reflinkmode",4]],[[["",0]],["attribute",4]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["attribute",4]],["ordering",4]],[[["",0]],["i32",0]],[[["",0],["clobbermode",4]],["bool",0]],[[["",0],["overwritemode",4]],["bool",0]],[[["",0],["reflinkmode",4]],["bool",0]],[[["",0],["attribute",4]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["",0]],["bool",0]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[]],[[]],[[]],[[["context",3,[["string",3],["error",3]]]],["error",4]],[[["error",3]],["error",4]],[[["string",3]],["error",4]],[[["str",0]],["error",4]],[[]],[[["error",3]],["error",4]],[[["stripprefixerror",3]],["error",4]],[[["context",3,[["str",0],["error",3]]]],["error",4]],[[]],[[]],[[]],[[]],[[["str",0]],["copyresult",6]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["path",3],["path",3],["path",3]],["copyresult",6,[["pathbuf",3]]]],[[["",0],["overwritemode",4]],["bool",0]],[[["",0],["attribute",4]],["option",4,[["ordering",4]]]],[[["path",3],["path",3]],["result",6,[["bool",0]]]],[[["path",3],["path",3]],["result",6,[["bool",0]]]],[[["",0]],["option",4,[["error",8]]]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[],["command",6]],[[],["i32",0]],[[["path",3],["targettype",4]],["copyresult",6]],null,null,null,null,null,null,null,null,null,null,null,null],"p":[[4,"ReflinkMode"],[4,"CopyMode"],[4,"Error"],[4,"OverwriteMode"],[4,"Attribute"],[4,"TargetType"],[4,"ClobberMode"],[3,"Options"],[13,"IoErr"],[13,"IoErrContext"],[13,"Error"],[13,"WalkDirErr"],[13,"StripPrefixError"],[13,"Skipped"],[13,"InvalidArgument"],[13,"NotImplemented"],[13,"Backup"],[13,"Clobber"],[13,"Interactive"]]},\
"uu_csplit":{"doc":"","t":[3,11,11,5,11,11,11,11,11,5,5],"n":["CsplitOptions","borrow","borrow_mut","csplit","from","into","try_from","try_into","type_id","uu_app","uumain"],"q":["uu_csplit","","","","","","","","","",""],"d":["Command line options for csplit.","","","Splits a file into severals according to the command line …","Returns the argument unchanged.","Calls U::from(self).","","","","",""],"i":[0,1,1,0,1,1,1,1,1,0,0],"f":[null,[[["",0]],["",0]],[[["",0]],["",0]],[[["csplitoptions",3],["vec",3,[["pattern",4]]]],["result",4,[["cspliterror",4]]]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[],["command",6]],[[],["i32",0]]],"p":[[3,"CsplitOptions"]]},\
"uu_cut":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_cut",""],"d":["",""],"i":[0,0],"f":[[[],["command",6]],[[],["i32",0]]],"p":[]},\
"uu_date":{"doc":"","t":[5,5],"n":["uu_app","uumain"],"q":["uu_date",""],"d":["",""],"i":[0,0],"f":[[[],["command",6]],[[],["i32",0]]],"p":[]},\
diff --git a/dev/src/uu_cp/cp.rs.html b/dev/src/uu_cp/cp.rs.html
index e504e4b7e..67e327765 100644
--- a/dev/src/uu_cp/cp.rs.html
+++ b/dev/src/uu_cp/cp.rs.html
@@ -1713,6 +1713,12 @@
1708
1709
1710
+1711
+1712
+1713
+1714
+1715
+1716
#![allow(clippy::missing_safety_doc)]
// This file is part of the uutils coreutils package.
@@ -1725,9 +1731,6 @@
// spell-checker:ignore (ToDO) ficlone linkgs lstat nlink nlinks pathbuf reflink strs xattrs symlinked
-#[cfg(any(target_os = "linux", target_os = "android"))]
-#[macro_use]
-extern crate ioctl_sys;
#[macro_use]
extern crate quick_error;
#[macro_use]
@@ -1776,9 +1779,6 @@
use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
use walkdir::WalkDir;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-ioctl!(write ficlone with 0x94, 9; std::os::raw::c_int);
-
quick_error! {
#[derive(Debug)]
pub enum Error {
@@ -1945,6 +1945,16 @@
verbose: bool,
}
+// From /usr/include/linux/fs.h:
+// #define FICLONE _IOW(0x94, 9, int)
+#[cfg(any(target_os = "linux", target_os = "android"))]
+// Use a macro as libc::ioctl expects u32 or u64 depending on the arch
+macro_rules! FICLONE {
+ () => {
+ 0x40049409
+ };
+}
+
static ABOUT: &str = "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.";
static LONG_HELP: &str = "";
static EXIT_ERR: i32 = 1;
@@ -3282,7 +3292,8 @@
.context(context)?;
match mode {
ReflinkMode::Always => unsafe {
- let result = ficlone(dst_file.as_raw_fd(), src_file.as_raw_fd() as *const i32);
+ let result = libc::ioctl(dst_file.as_raw_fd(), FICLONE!(), src_file.as_raw_fd());
+
if result != 0 {
Err(format!(
"failed to clone {:?} from {:?}: {}",
@@ -3296,7 +3307,8 @@
}
},
ReflinkMode::Auto => unsafe {
- let result = ficlone(dst_file.as_raw_fd(), src_file.as_raw_fd() as *const i32);
+ let result = libc::ioctl(dst_file.as_raw_fd(), FICLONE!(), src_file.as_raw_fd());
+
if result != 0 {
fs::copy(source, dest).context(context)?;
}
diff --git a/dev/src/uu_sleep/sleep.rs.html b/dev/src/uu_sleep/sleep.rs.html
index 4de38e264..890d4a133 100644
--- a/dev/src/uu_sleep/sleep.rs.html
+++ b/dev/src/uu_sleep/sleep.rs.html
@@ -108,7 +108,7 @@ specified by the sum of their values.";
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
- let matches = uu_app().get_matches_from(args);
+ let matches = uu_app().try_get_matches_from(args)?;
if let Some(values) = matches.values_of(options::NUMBER) {
let numbers = values.collect::<Vec<_>>();
diff --git a/dev/uu_cp/all.html b/dev/uu_cp/all.html
index 2abdac18d..a057a2052 100644
--- a/dev/uu_cp/all.html
+++ b/dev/uu_cp/all.html
@@ -3,5 +3,5 @@
+ Crate uu_cp