diff --git a/bash-5.1/.cargo/config.toml b/bash-5.1/.cargo/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..11bdee268c6482560d4bb54326142673fb3ff073 --- /dev/null +++ b/bash-5.1/.cargo/config.toml @@ -0,0 +1,6 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" + diff --git a/bash-5.1/builtins_rust/common/src/lib.rs b/bash-5.1/builtins_rust/common/src/lib.rs index 1e48063864edccc01012cb39dad7d68d6d0b07e6..50f96f7656a9eea4fd34b63b72ac9611589b16eb 100644 --- a/bash-5.1/builtins_rust/common/src/lib.rs +++ b/bash-5.1/builtins_rust/common/src/lib.rs @@ -1766,7 +1766,7 @@ pub extern "C" fn get_local_str()-> Vec{ println!("err is {e:?}") }, } - println!("now language is {:?}",lang); + // println!("now language is {:?}",lang); //parse() 用于类型转换 let langid : LanguageIdentifier = lang.parse().expect("wrong language"); let locales = vec![langid.into()]; diff --git a/bash-5.1/builtins_rust/exec_cmd/src/lib.rs b/bash-5.1/builtins_rust/exec_cmd/src/lib.rs index 3aad47b4d0810cbc7b5e09a9df490131931c5bf0..ad9fc7066ba85fda35bb67c6b9606c177c4d8981 100644 --- a/bash-5.1/builtins_rust/exec_cmd/src/lib.rs +++ b/bash-5.1/builtins_rust/exec_cmd/src/lib.rs @@ -641,7 +641,7 @@ impl Factory for SimpleFactory { ReservedComand{} ), CMDType::ReturnCmd => Box::new( - ReadComand{} + ReturnComand{} ), CMDType::SetattrCmd => Box::new( SetattrComand{} @@ -899,10 +899,10 @@ unsafe fn get_cmd_type (command : *mut libc::c_char) -> CMDType{ #[no_mangle] pub extern "C" fn r_exec_cmd(command : *mut libc::c_char, mut list :*mut WordList) -> i32 { - println!("enter r_exec_cmd"); - unsafe { - println!("command is {:?}",CStr::from_ptr(command)); - } + // println!("enter r_exec_cmd"); + // unsafe { + // println!("command is {:?}",CStr::from_ptr(command)); + // } let commandType = unsafe {get_cmd_type(command)}; let factory = SimpleFactory::new(); let cmdCall = factory.make_product(commandType); diff --git a/bash-5.1/builtins_rust/help/src/lib.rs b/bash-5.1/builtins_rust/help/src/lib.rs index 7e51d7da6ad69f8ceade35646d98f691e3ab18a6..2df677f23edfcb68a26f143b39699c834a3968c6 100644 --- a/bash-5.1/builtins_rust/help/src/lib.rs +++ b/bash-5.1/builtins_rust/help/src/lib.rs @@ -201,22 +201,28 @@ pub extern "C" fn r_help_builtin(mut list:*mut WordList)->i32 { this_found = 1; match_found = match_found +1 ; if dflag == 1{ - show_desc (v[i], i as i32); - //continue; + continue; } else if mflag ==1{ - show_manpage (v[i], i as i32); continue; } - unsafe { - let builtin1 = &(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin)); + let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; - println! ("{:?}: {:?}\n", CStr::from_ptr(v[i]), CStr::from_ptr(builtin1.short_doc)); - } - if sflag == 0{ - + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); + let bundle = mgr.get_bundle(get_local_str(), resources); + let mut value = bundle.get_message("helpsynopsis").unwrap(); + let mut pattern = value.value().expect("partern err"); + let mut errors = vec![]; + let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}:{}\n",msg ,msg1); + if sflag == 0{ show_longdoc (i as i32); } } @@ -312,114 +318,36 @@ fn open_helpfile(name :*mut c_char) -> i32{ } fn show_longdoc(i : i32){ - let mut j : i32; - let mut doc :*mut (*mut c_char); - let mut fd : i32; - let mut usefile : bool ; - let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - unsafe { - doc = builtin1.long_doc; - usefile = doc!= std::ptr::null_mut() && (doc as usize + 8 as usize) as * mut c_char != std::ptr::null_mut(); - usefile = usefile && char::from(unsafe {*((*doc as usize) as * mut c_char) as u8 })== '/'; - // usefile = usefile && unsafe{*((doc as usize + 8 as usize)as *mut *mut libc::c_char) as *mut libc::c_char} == std::ptr::null_mut(); - //usefile = usefile && ((doc as usize + 8 as usize) as * mut c_char) == std::ptr::null_mut(); - //usefile = usefile && (*(doc as usize + 8 as usize) as *mut libc::c_char )as char== '/' as char ; - //usefile = doc!= std::ptr::null_mut() && *((doc as usize + ) as * mut c_char)== '/' as libc::c_char && (doc as usize +4)as * mut c_char == std::ptr::null_mut() as * mut c_char; - } - // let usefile = (doc!= std::ptr::null_mut() && char::from(unsafe {*((doc + 4*8) as usize ) as * mut c_char) as u8 })== '/'); - if usefile { - unsafe { - fd = open_helpfile (*builtin1.long_doc); - } - if (fd < 0){ - //无返回值 - return (); - } - unsafe { - zcatfd (fd, 1, *doc); - libc::close (fd); - } - /* XXX - handle errors if zmapfd returns < 0 */ - } - else if doc!= std::ptr::null_mut() { - let mut j = 0 ; - unsafe { - println!("{:?}",CStr::from_ptr(*doc)); - } - } - // while unsafe {*((doc as usize+(8*j) as usize)as * mut * mut c_char) as *mut c_char }!= std::ptr::null_mut(){ - // unsafe { - // println! ("{:?}{:?} {:?}", BASE_INDENT!()," ", CStr::from_ptr(*((doc as usize+(8*j) as usize)as * mut * mut c_char) as *mut c_char)); - // j += 1; - // } - // } - // } + let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); + let bundle = mgr.get_bundle(get_local_str(), resources); + let mut value = bundle.get_message("helpsynopsis").unwrap(); + let mut pattern = value.value().expect("partern err"); + let mut errors = vec![]; + let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}", msg1); } fn show_desc (name : *mut c_char, i :i32){ + let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; - let mut j :i32; - let r :i32; - let mut doc : *mut *mut libc::c_char; - let mut line : *mut libc::c_char = 0 as *mut libc::c_char ; - let mut fd : i32; - let mut usefile : bool; - - let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - unsafe { - doc = builtin1.long_doc; - } - // usefile = (doc && doc[0] && *doc[0] == '/' && doc[1] == (char *)NULL); - usefile = doc!= std::ptr::null_mut() && unsafe {*doc as *mut libc::c_char} != std::ptr::null_mut(); - usefile = usefile && unsafe {**doc as libc::c_char } == '/' as libc::c_char; - //usefile = usefile && unsafe {*(doc as usize + 8 as usize) as *mut libc::c_char} != std::ptr::null_mut(); - if usefile { - - fd = open_helpfile (unsafe {*doc as *mut libc::c_char }); - if (fd < 0){ - //无返回值 - return (); - } - unsafe { - r = zmapfd (fd, *(line as *mut libc::c_char) as *mut *mut libc::c_char ,(doc as *mut libc::c_char)); - libc::close (fd); - } - /* XXX - handle errors if zmapfd returns < 0 */ - } - else - { - if doc!= std::ptr::null_mut() { - unsafe { - line = *doc as *mut libc::c_char; - } - } - else{ - - line = std::ptr::null_mut(); - } - } - - unsafe { - println!("{:?}",CStr::from_ptr(name)); - } - let mut j = 0 ; - while ((line as usize + (8*j)) as * mut c_char)!= std::ptr::null_mut() { - unsafe { - libc::putchar (*((line as usize + (8*j))as * mut c_char) as i32); - if char::from(*((line as usize + (8*j))as * mut c_char) as u8)== '\n'{ - break; - } - } - j += 1; - } - unsafe { - std::io::stdout().flush(); - } - if usefile{ - unsafe { - libc::free (line as * mut c_void); - } - } + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); + let bundle = mgr.get_bundle(get_local_str(), resources); + let mut value = bundle.get_message("helpname").unwrap(); + let mut pattern = value.value().expect("partern err"); + let mut errors = vec![]; + let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}", msg1); } fn show_manpage (name : *mut c_char, i : i32){ @@ -432,37 +360,11 @@ fn show_manpage (name : *mut c_char, i : i32){ let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); let resources = vec![ "message.ftl".into()]; unsafe { - doc = builtin1.long_doc; } //*doc = (*((shell_builtins as usize + i as usize) as *mut builtin).long_doc as *mut libc::c_char); usefile = doc!= std::ptr::null_mut() && unsafe {*doc as *mut libc::c_char} != std::ptr::null_mut(); usefile = usefile && unsafe {**doc as libc::c_char } == '/' as libc::c_char; - - if usefile{ - - unsafe { - fd = open_helpfile (*doc); - } - if fd < 0 { - //无返回值 - return (); - } - unsafe{ - zmapfd (fd, line as *mut *mut libc::c_char, *doc); - libc::close (fd); - } - } - else { - if doc!= std::ptr::null_mut(){ - unsafe { - line = *doc as *mut libc::c_char; - } - } - else{ - line = std::ptr::null_mut(); - } - } /* NAME */ println! ("NAME\n"); let mut args = FluentArgs::new(); @@ -474,42 +376,23 @@ fn show_manpage (name : *mut c_char, i : i32){ let mut pattern = value.value().expect("partern err"); let mut errors = vec![]; let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); - println!("{}", msg1); - let mut j = 0 ; - unsafe { - while (*((doc as usize + (8*j))as *mut *mut c_char)as *mut c_char) != std::ptr::null_mut() { - libc::putchar (*((line as usize + (8*j)) as * mut c_char) as i32); - if char::from(*((line as usize + (8*j))as * mut c_char) as u8) == '\n'{ - break; - } - j += 1; - } - } - - println! ("\n"); + println!(" {}\n", msg1); /* SYNOPSIS */ println! ("SYNOPSIS\n"); - unsafe { - println! (" {:?}\n", CStr::from_ptr(builtin1.short_doc)); - } + value = bundle.get_message("helpsynopsis").unwrap(); + pattern = value.value().expect("partern err"); + msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}\n", msg1); + // println! (" {:?}\n", CStr::from_ptr(builtin1.short_doc)); /* DESCRIPTION */ println! ("DESCRIPTION\n"); if !usefile{ value = bundle.get_message("helplongdoc").unwrap(); pattern = value.value().expect("partern err"); msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); - println!("{}", msg1); + println!("{}\n", msg1); } - else{ - while doc != std::ptr::null_mut() && (((doc as usize + (8*j)))as * mut c_char) != std::ptr::null_mut() { - unsafe { - libc::putchar (*((doc as usize + (8*j))as * mut c_char)as i32); - } - println! (" "); - } - j += 1; - } unsafe { libc::putchar ('\n' as i32); } diff --git a/bash-5.1/resources/en-US/message.ftl b/bash-5.1/resources/en-US/message.ftl index 64091a658ba38a9a0daa59ae5a6cf9816515f7a7..a4a673a99b6c692973f95f5f13896b6869c7a033 100644 --- a/bash-5.1/resources/en-US/message.ftl +++ b/bash-5.1/resources/en-US/message.ftl @@ -787,7 +787,7 @@ $cmdName -> Exit Status: Always succeeds. - [limit] Modify shell resource limits. + [ulimit] Modify shell resource limits. Provides control over the resources available to the shell and processes @@ -1459,7 +1459,7 @@ $cmdName -> [suspend] suspend - Suspend shell execution. [eval] eval - Evaluate conditional expression. [times] times - Display process times. -[limit] limit - Modify shell resource limits. +[ulimit] limit - Modify shell resource limits. [umask] umask - Display or set file mode mask. [return] return - Wait for job completion and return exit status. [wait] wait -Wait for process completion and return exit status. @@ -1491,4 +1491,76 @@ $cmdName -> [bind] bind - Set Readline key bindings and variables.。 [test] test - Evaluate arithmetic expressions. *[other] show other command help info.. -} \ No newline at end of file +} + +helpsynopsis = { +$cmdName -> +[set] {"set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]"} +[read] {"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]"} +[type] {"type [-afptP] name [name ...]"} +[trap] {"trap [-lp] [[arg] signal_spec ...]"} +[alias] {"alias [-p] [name[=value] ... ]"} +[unalias] {"unalias [-a] name [name ...]"} +[break] {"break [n]"} +[continue] {"continue [n]"} +[builtin] {"unalias [-a] name [name ...]"} +[caller] {"caller [expr] "} +[cd] {"cd [-L|[-P [-e]] [-@]] [dir]"} +[pwd] {"pwd [-LP]"} +[true] {"true"} +[shopt] {"shopt [-pqsu] [-o] [optname ...]"} +[false] {"false"} +[command] {"command [-pVv] command [arg ...]"} +[echo] {"echo [-neE] [arg ...]"} +[enable] {"enable [-a] [-dnps] [-f filename] [name ...] "} +[getopts] {"getopts optstring name [arg ...]"} +[exec] {"exec [-cl] [-a name] [command [argument ...]] [redirection ...] "} +[exit] {"exit [n]"} +[logout] {"logout [n]"} +[fc] {"fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]"} +[fg] {"fg [job_spec] "} +[bg] {"bg [job_spec ...]"} +[hash] {"hash [-lr] [-p pathname] [-dt] [name ...]"} +[help] {"help [-dms] [pattren ...]"} +[history] {"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]"} +[jobs] {"jobs [-lnprs] [jobspec ...] or jobs -x command [args]"} +[disown] {"disown [-h] [-ar] [jobspec ... | pid ...]"} +[kill] {"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]"} +[let] {"let arg [arg ...]"} +[shift] {"shift [n]"} +[suspend] {"suspend [-f]"} +[eval] {"eval [arg ...]"} +[times] {"times"} +[ulimit] {"ulimit [-SHabcdefiklmnpqrstuvxPT] [ulimit]"} +[umask] {"umask [-p] [-S] [pattern]"} +[return] {"return [n]"} +[wait] {"wait [-fn] [-p var] [id ...]"} +[for] {"for NAME [in WORDS ... ] ; do COMMANDS; done"} +[select] {"select NAME [in WORDS ... ;] do COMMANDS; done"} +[time] {"time [-p] pipeline"} +[case] {"case WORD in [pattern [| pattern]...) COMMANDS ;;]... esac"} +[if] {"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi"} +[while] {"while COMMANDS; do COMMANDS; done"} +[until] {"until COMMANDS; do COMMANDS; done"} +[coproc] {"coproc [NAME] COMMANDS [redirections]"} +[variables] {"variables - variables - Names and meanings of some shell variables"} +[pushd] {"pushd [-n] [+N | -N | dir]"} +[popd] {"popd [-n] [+N | -N]"} +[dirs] {"dirs [-clpv] [+N] [-N]"} +[printf] {"printf [-v var] format [arguments]"} +[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]"} +[compgen] {"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]"} +[compopt] {"compopt [-o|+o option] [-DEI] [name ...]"} +[mapfile] {"mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]]"} +[unset] {"unset [-f] [-v] [-n] [NAME ...]"} +[readarray] {"readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]"} +[local] {"local [option] name[=value] ... "} +[export] {"export [-fn] [name[=value] ...] or export -p"} +[readonly] {"readonly [-aAf] [name[=value] ...] or readonly -p"} +[function] {"function NAME { COMMANDS ; } 或 name () { COMMANDS ; } "} +[typeset] {"typeset [-aAfFgiIlnrtux] [-p] name[=value] ..."} +[source] {"source filename [arguments]"} +[bind] {"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command] "} +[test] {"test [expr]"} +*[other] show other command help info.. +} diff --git a/bash-5.1/resources/zh-CN/message.ftl b/bash-5.1/resources/zh-CN/message.ftl index 4ca3b5f17118804aa1aca8653b98b8180a36cb1a..f7e1faf2d325797e88b1c1ed019f4792c2651c56 100644 --- a/bash-5.1/resources/zh-CN/message.ftl +++ b/bash-5.1/resources/zh-CN/message.ftl @@ -735,7 +735,7 @@ $cmdName -> 退出状态 总是成功。 - [limit] 修改 shell 资源限制。 + [ulimit] 修改 shell 资源限制。 在允许此类控制的系统上,提供对于 shell 及其创建的进程所可用的 资源的控制。 @@ -1305,7 +1305,7 @@ $cmdName -> [suspend] suspend - 挂起 shell 执行。 [eval] eval - 对条件表达式进行估值。 [times] times - 显示进程时间 -[limit] limit - 修改 shell 资源限制。 +[ulimit] limit - 修改 shell 资源限制。 [umask] umask - 显示或设定文件模式掩码。 [return] return - 等待任务完成并返回退出状态。 [wait] wait - 等待进程完成并且返回退出状态。 @@ -1337,4 +1337,78 @@ $cmdName -> [bind] bind - 设定 Readline 键绑定和变量。 [test] test - 估值算术表达式。 *[other] 显示其他命令帮助信息 . + + +} + +helpsynopsis = { +$cmdName -> +[set] {"set [--abefhkmnptuvxBCHP][-o 选项名][--][参数 ...]"} +[read] {"read [-ers] [-a 数组] [-d 分隔符] [-i 缓冲区文字] [-n 读取字符数] [-N 读取字符数] [-p 提示符] [-t 超时] [-u 文件描述符] [名称 ...]"} +[type] {"type [-afptP] 名称 [名称 ...]"} +[trap] {"trap: trap [-lp] [[参数] 信号声明 ...]"} +[alias] {"alias [-p] [名称[=值] ... ]"} +[unalias] {"unalias [-a] 名称 [名称 ...] "} +[break] {"break [n]"} +[continue] {"continue [n]"} +[builtin] {"builtin [shell 内建 [参数 ...]] "} +[caller] {"caller [表达式] "} +[cd] {"cd [-L|[-P [-e]] [-@]] [目录]"} +[pwd] {"pwd [-LP]"} +[true] {"true"} +[shopt] {"shopt [-pqsu] [-o] [选项名 ...]"} +[false] {"false"} +[command] {"command [-pVv] 命令 [参数 ...]"} +[echo] {"echo [-neE] [参数 ...]"} +[enable] {"enable [-a] [-dnps] [-f 文件名] [名称 ...] "} +[getopts] {"getopts 选项字符串 名称 [参数]"} +[exec] {"exec [-cl] [-a 名称] [命令 [参数 ...]] [重定向 ...] "} +[exit] {"exit [n]"} +[logout] {"logout [n]"} +[fc] {"fc [-e 编辑器名] [-lnr] [起始] [终结] 或 fc -s [模式=替换串] [命令]"} +[fg] {"fg [任务声明] "} +[bg] {"bg [任务声明 ...]"} +[hash] {"hash [-lr] [-p 路径名] [-dt] [名称 ...]"} +[help] {"help [-dms] [模式 ...]"} +[history] {"history [-c] [-d 偏移量] [n] 或 history -anrw [文件名] 或 history -ps 参数 [参数...]"} +[jobs] {"jobs [-lnprs] [任务声明 ...] 或 jobs -x 命令 [参数]"} +[disown] {"disown [-h] [-ar] [任务声明 ... | pid ...]"} +[kill] {"kill [-s 信号声明 | -n 信号编号 | -信号声明] 进程号 | 任务声明 ... 或 kill -l [信号声明]"} +[let] {"let 参数 [参数 ...]"} +[shift] {"shift [n]"} +[suspend] {"suspend [-f]"} +[eval] {"eval [参数 ...]"} +[times] {"times"} +[ulimit] {"ulimit [-SHabcdefiklmnpqrstuvxPT] [限制]"} +[umask] {"umask [-p] [-S] [模式]"} +[return] {"return [n]"} +[wait] {"wait [-fn] [编号 ...]"} +[for] {"for 名称 [in 词语 ... ] ; do 命令; done"} +[select] {"select NAME [in 词语 ... ;] do 命令; done"} +[time] {"time [-p] 管道"} +[case] {"case 词 in [模式 [| 模式]...) 命令 ;;]... esac"} +[if] {"if 命令; then 命令; [ elif 命令; then 命令; ]... [ else 命令; ] fi"} +[while] {"while 命令; do 命令; done"} +[until] {"until 命令; do 命令; done"} +[coproc] {"coproc [名称] 命令 [重定向]"} +[variables] {"variables - 一些 shell 变量的名称和含义"} +[pushd] {"pushd [-n] [+N | -N | 目录]"} +[popd] {"popd [-n] [+N | -N]"} +[dirs] {"dirs [-clpv] [+N] [-N]"} +[printf] {"printf [-v var] 格式 [参数]"} +[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o 选项] [-A 动作] [-G 全局模式][-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [名称 ...]"} +[compgen] {"compgen [-abcdefgjksuv] [-o 选项] [-A 动作] [-G 全局模式] [-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [词语]"} +[compopt] {"compopt [-o|+o 选项] [-DEI] [名称 ...]"} +[mapfile] {"mapfile [-d 分隔符] [-n 计数] [-O 起始序号] [-s 计数] [-t] [-u fd] [-C 回调] [-c 量子] [数组]"} +[unset] {"unset [-f] [-v] [-n] [名称 ...]"} +[readarray] {"readarray [-d 定界符] [-n 计数] [-O 起始序号] [-s 计数] [-t] [-u fd] [-C 回调] [-c 量子] [数组]"} +[local] {"local [option] 名称[=值] ... "} +[export] {"export [-fn] [名称[=值] ...] 或 export -p"} +[readonly] {"readonly [-aAf] [名称[=值] ...] 或 readonly -p"} +[function] {"function 名称 { 命令 ; } 或 name () { 命令 ; } "} +[typeset] {"typeset [-aAfFgilnrtux] [-p] 名称[=值] ..."} +[source] {"source 文件名 [参数]"} +[bind] {"bind [-lpvsPSVX] [-m 键映射] [-f 文件名] [-q 名称] [-u 名称] [-r 键序列] [-x 键序列:shell-命令] [键序列:readline-函数 或 readline-命令] "} +[test] {"test [表达式]"} +*[other] 显示其他命令帮助信息 } diff --git a/bash-5.1/resources/zh-HK/message.ftl b/bash-5.1/resources/zh-HK/message.ftl index c6f85a0aec6f8022138fcdf536d16e5ecde43eab..6e07aed1f5ba302b5cc79e2c1f7a4a1d66c880f0 100644 --- a/bash-5.1/resources/zh-HK/message.ftl +++ b/bash-5.1/resources/zh-HK/message.ftl @@ -736,7 +736,7 @@ $cmdName -> 退出状态 总是成功。 - [limit] 修改 shell 资源限制。 + [ulimit] 修改 shell 资源限制。 在允许此类控制的系统上,提供对于 shell 及其创建的进程所可用的 资源的控制。 @@ -1306,7 +1306,7 @@ $cmdName -> [suspend] suspend - 挂起 shell 执行。 [eval] eval - 对条件表达式进行估值。 [times] times - 显示进程时间 -[limit] limit - 修改 shell 资源限制。 +[ulimit] limit - 修改 shell 资源限制。 [umask] umask - 显示或设定文件模式掩码。 [return] return - 等待任务完成并返回退出状态。 [wait] wait - 等待进程完成并且返回退出状态。 @@ -1339,3 +1339,75 @@ $cmdName -> [test] test - 估值算术表达式。 *[other] 显示其他命令帮助信息 . } + +helpsynopsis = { +$cmdName -> +[set] {"set [--abefhkmnptuvxBCHP][-o 选项名][--][参数 ...]"} +[read] {"read [-ers] [-a 数组] [-d 分隔符] [-i 缓冲区文字] [-n 读取字符数] [-N 读取字符数] [-p 提示符] [-t 超时] [-u 文件描述符] [名称 ...]"} +[type] {"type [-afptP] 名称 [名称 ...]"} +[trap] {"trap: trap [-lp] [[参数] 信号声明 ...]"} +[alias] {"alias [-p] [名称[=值] ... ]"} +[unalias] {"unalias [-a] 名称 [名称 ...] "} +[break] {"break [n]"} +[continue] {"continue [n]"} +[builtin] {"builtin [shell 内建 [参数 ...]] "} +[caller] {"caller [表达式] "} +[cd] {"cd [-L|[-P [-e]] [-@]] [目录]"} +[pwd] {"pwd [-LP]"} +[true] {"true"} +[shopt] {"shopt [-pqsu] [-o] [选项名 ...]"} +[false] {"false"} +[command] {"command [-pVv] 命令 [参数 ...]"} +[echo] {"echo [-neE] [参数 ...]"} +[enable] {"enable [-a] [-dnps] [-f 文件名] [名称 ...] "} +[getopts] {"getopts 选项字符串 名称 [参数]"} +[exec] {"exec [-cl] [-a 名称] [命令 [参数 ...]] [重定向 ...] "} +[exit] {"exit [n]"} +[logout] {"logout [n]"} +[fc] {"fc [-e 编辑器名] [-lnr] [起始] [终结] 或 fc -s [模式=替换串] [命令]"} +[fg] {"fg [任务声明] "} +[bg] {"bg [任务声明 ...]"} +[hash] {"hash [-lr] [-p 路径名] [-dt] [名称 ...]"} +[help] {"help [-dms] [模式 ...]"} +[history] {"history [-c] [-d 偏移量] [n] 或 history -anrw [文件名] 或 history -ps 参数 [参数...]"} +[jobs] {"jobs [-lnprs] [任务声明 ...] 或 jobs -x 命令 [参数]"} +[disown] {"disown [-h] [-ar] [任务声明 ... | pid ...]"} +[kill] {"kill [-s 信号声明 | -n 信号编号 | -信号声明] 进程号 | 任务声明 ... 或 kill -l [信号声明]"} +[let] {"let 参数 [参数 ...]"} +[shift] {"shift [n]"} +[suspend] {"suspend [-f]"} +[eval] {"eval [参数 ...]"} +[times] {"times"} +[ulimit] {"ulimit [-SHabcdefiklmnpqrstuvxPT] [限制]"} +[umask] {"umask [-p] [-S] [模式]"} +[return] {"return [n]"} +[wait] {"wait [-fn] [编号 ...]"} +[for] {"for 名称 [in 词语 ... ] ; do 命令; done"} +[select] {"select NAME [in 词语 ... ;] do 命令; done"} +[time] {"time [-p] 管道"} +[case] {"case 词 in [模式 [| 模式]...) 命令 ;;]... esac"} +[if] {"if 命令; then 命令; [ elif 命令; then 命令; ]... [ else 命令; ] fi"} +[while] {"while 命令; do 命令; done"} +[until] {"until 命令; do 命令; done"} +[coproc] {"coproc [名称] 命令 [重定向]"} +[variables] {"variables - 一些 shell 变量的名称和含义"} +[pushd] {"pushd [-n] [+N | -N | 目录]"} +[popd] {"popd [-n] [+N | -N]"} +[dirs] {"dirs [-clpv] [+N] [-N]"} +[printf] {"printf [-v var] 格式 [参数]"} +[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o 选项] [-A 动作] [-G 全局模式] [-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [名称 ...]"} +[compgen] {"compgen [-abcdefgjksuv] [-o 选项] [-A 动作] [-G 全局模式] [-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [词语]"} +[compopt] {"compopt [-o|+o 选项] [-DEI] [名称 ...]"} +[mapfile] {"mapfile [-d 分隔符] [-n 计数] [-O 起始序号] [-s 计数] [-t] [-u fd] [-C 回调] [-c 量子] [数组]"} +[unset] {"unset [-f] [-v] [-n] [名称 ...]"} +[readarray] {"readarray [-d 定界符] [-n 计数] [-O 起始序号] [-s 计数] [-t] [-u fd] [-C 回调] [-c 量子] [数组]"} +[local] {"local [option] 名称[=值] ... "} +[export] {"export [-fn] [名称[=值] ...] 或 export -p"} +[readonly] {"readonly [-aAf] [名称[=值] ...] 或 readonly -p"} +[function] {"function 名称 { 命令 ; } 或 name () { 命令 ; } "} +[typeset] {"typeset [-aAfFgilnrtux] [-p] 名称[=值] ..."} +[source] {"source 文件名 [参数]"} +[bind] {"bind [-lpvsPSVX] [-m 键映射] [-f 文件名] [-q 名称] [-u 名称] [-r 键序列] [-x 键序列:shell-命令] [键序列:readline-函数 或 readline-命令] "} +[test] {"test [表达式]"} +*[other] 显示其他命令帮助信息 . +} diff --git a/bash-5.1/vendor/libc/.cargo-checksum.json b/bash-5.1/vendor/libc/.cargo-checksum.json index f16c56427587e7d18b473f77c92fbd647b0aae4f..26956a4348c18265ea61420d4075eb45a2b9a4d9 100644 --- a/bash-5.1/vendor/libc/.cargo-checksum.json +++ b/bash-5.1/vendor/libc/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CONTRIBUTING.md":"f480d10d2a506eecd23ae2e2dedb7a28b8bf6dae5f46f438dbb61be2003426fb","Cargo.toml":"1549dc2db0ecd74316f52b2d14b15144ae970a848bf3d54c048844ed7a35df2a","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"776affa26b66843a2b4f1a1c8f88d92f6461b74568911450fea717e9db6f877b","build.rs":"1d0cbe878e98e970c3318cac0772215a9f44bd286d859d665da27872ba9d8818","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"94cbaad15021e287a1b9546a697b04c1e560f1204b52204ffaaea5975c5d03b9","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"ce753ef318b300bbd441feabdd77d00322dfb6ce9eee8c78a38afe02b57aa4c0","src/macros.rs":"b457eb028b8e8ab3c24bb7292b874ad4e491edbb83594f6a3da024df5348c088","src/psp.rs":"dd31aabd46171d474ec5828372e28588935120e7355c90c105360d8fa9264c1c","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"e8eb38d064b5fefec6f37d42873820a0483e7c758ed336cc59a7155455ca89c9","src/unix/bsd/apple/b64/aarch64/mod.rs":"a3f0dfff62d0f7f4f1b5f9a4e2b662acf233a46badbc5419d3cc2d735629a710","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/mod.rs":"56dc7604509f49b274770cade97a1874c8955c3b0a445fb857707ae0ca6df41b","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"d0e8246063cae113806524a63a47c6c0628cc54a3ef03e938e89964f8b4f08b4","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"2a215bd6136b8617aacedf9be738ccee94da9d29b418e9a78101d6291c182352","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"a6eee615e6ca5a6e04b526bb6b22d13b9356e87e51825cda33476c37a46cb0ef","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"755dafaf3f0945e798c34ea94c48e8552804ce60e2a15a4f0649f9d1aceaf422","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"cc65a73b0fa95a77044a4b3ee76d6eceb9773b55aea7d73bdf070e6f66e9ea38","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"0ed92eb93e78299cd7de0ae9daebb04a53b3c2d5e6a078e1fcd977f2a86bffc3","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/mod.rs":"ec229cc7af2511cb510c078e87e90ee2625090bfe94f40eb35f73d79143533aa","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"8f591bd273464d684c4f64365f8ed56a8138175daa70d96008541393057a0dae","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"1e35b4773384ea143810cdce4b96f47108b37446430da30c96a0d1651656d73d","src/unix/bsd/mod.rs":"817ca5719c36a74c84e52c6a56a5998b60d7f02351a405e034f08ebab079b63a","src/unix/bsd/netbsdlike/mod.rs":"b07a0e81085bd811fce7270f3b90fbfea29faf9593d9e39d9d2ebbb9a78bf25f","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"65dcb58d11e8d8028401a9d07ca3eb4cb4f053e04249cc877353449d84ccc4cb","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"8f9613e50c2771b33d7cf817a735d536b389ec57f861b9486d870373c768276e","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"1afe5ef46b14397cdd68664b5b232e4f5b035b6db1d4cf411c899d51ebca9f30","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"228505fa48292e74b06acbed96196801595a4b822da2126a6d6c7fa773cff8bc","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"df7b6b7d8dd3441665bfe87f2abc942bddc65b8b10dfa9c83dd0422f68107891","src/unix/haiku/native.rs":"dbfcbf4954a79d1df2ff58e0590bbcb8c57dfc7a32392aa73ee4726b66bd6cc8","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"859814f5df89e28fd4b345db399d181e11e7ed413841b6ff703a1fcbdbf013ae","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"433c1530f602cc5ed26610c58055dde0c4ceea5e00150063b24ddc60768332a4","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"8388bd3a0fcb5636bf965eee6dc95ae6860b85a2b555b387c868aa4d4e01ec89","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"ef230d49fd0d182adf2dae6f8e10babf18d72259d65980bf1c4c2dc8a4f84501","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"80e9f93fed838a48b4e2e8d77b95c72cfd7c0647bcce63851555c5ad16dad143","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"e10d19bea39f719723ab6666a5ddbd378b6958769441c5904629e1df173b1dc2","src/unix/linux_like/android/mod.rs":"962741303dc24a5b9653f2e9b0b4ad9eb42fc54daa0a70ca70a7ce175e75094b","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"c69c90606d4362f8de89b8816df0ded724ed64b53bf55d15681fde171b7bb361","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"d6c259942c8e843373accd180fc8f4f45f03544dfd21b93a8d02641ead3ef63e","src/unix/linux_like/linux/arch/generic/mod.rs":"e20013ed91edcfb7f84f3f9f5a9ef827fd5c406e24b65989d8438da332236ef6","src/unix/linux_like/linux/arch/mips/mod.rs":"2d166054a586bb4bf6e4a4ba35f7574907b217225eff8f1a43adc4277e142460","src/unix/linux_like/linux/arch/mod.rs":"466a29622e47c6c7f1500682b2eb17f5566dd81b322cd6348f0fdd355cec593a","src/unix/linux_like/linux/arch/powerpc/mod.rs":"3f6da7b0fa7b394c7d4eea2bb3caa7a7729ab0d6c1491fef02206a912c41b815","src/unix/linux_like/linux/arch/sparc/mod.rs":"91593ec0440f1dd8f8e612028f432c44c14089286e2aca50e10511ab942db8c3","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"92ea7edc0e24f79dfbf5e3efc2d7509bed230562036e6aa85ef4f2c8088ecc8f","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"a2a0a9400dae44086ebf579e0448e0676d4a3214d1ae7d13a024857251e23b6b","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"0d7849eb2435ec1f49b6774872a0518f0129c50f37c9d38b37b1535722777a22","src/unix/linux_like/linux/gnu/b32/mod.rs":"8da281da578cdee972e952b118b903b370320897a7e335342a15e1359864bef2","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"049d6211ba4a9304bd4497c160bc21ae847c24e0528dd9d76263f16192e6aff5","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"a4256148cec0bb672c8dfa605866930d9761af9655721de72ae41eeeb8fdbf6d","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"525618615aa0cb80c6c90860bf579dfed8db307fffd56b97dc235fb945419434","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"78b4038852986436888c63be9258037cf642124daee9d5fa5cef2bf8e412bf54","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"5b32fcc0d60356c92ded4e0ba9bb32f0140a8bd75ba800486bf38294f61dbdbb","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"21a21503ef2e095f4371044915d4bfb07a8578011cb5c713cd9f45947b0b5730","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"e78c3cd197f44832338b414d1a9bc0d194f44c74db77bd7bf830c1fff62b2690","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"c72a08011c32f82919e930e0d89044d8feb65fd41bf80647436756c290344eb8","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"387808d5398b24339e7e2bf7591150735011befc5b421fa713d7017c04a7b1da","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"17aad16329431d83e1909e3a08022f6e28f4bcba7dec4a967fe1a321a6a43b99","src/unix/linux_like/linux/gnu/b64/mod.rs":"3c6555f30a7a8852757b31a542ea73fb6a16a6e27e838397e819278ad56e57a4","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"97e0ecf11ecce793a13fec39654fb513c5479edf7faa7a276fa714b61993d0fc","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"b3fe290afe63d2d6e315d0cf1f775464e9c1f2a1906d243c1af74a137a4031cb","src/unix/linux_like/linux/gnu/b64/s390x.rs":"254f00266ecf9644a4b469457cb37c4dd6c055820926c1de0fb9035b6048e75c","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"87dd7f3d5bf3c09f4064ec738e306cc9cc41ad49b4a5df62c5983301c3bbf99a","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"f0db9914315d5a3d51bf5ec04a0ae6584f2e1688b9258ce132b617e67d9bd7a9","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"b88ef8a1eaa9ed73bf2acb8192afb73af987a92abb94140c6376fc83f2fa5553","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"79305936a60d342efdc10519ba89507d6b48e65f13f33090d3b04dc9655ceed0","src/unix/linux_like/linux/gnu/mod.rs":"fd62b48974dd2f97f6e8fa2a30624e8d69fdedc5d3b0ab2f3f09516e88a8769a","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"af94b1a6d844bed87bb4c93de0a12f160ca1f918f5234d7fe17511d4e424dedc","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"e5faee8efda8a225ea0b17d4d6f9e893a678e73773fa62c549a8e19c106b9f04","src/unix/linux_like/linux/musl/b32/hexagon.rs":"226a8b64ce9c75abbbee6d2dceb0b44f7b6c750c4102ebd4d015194afee6666e","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"df8f8b529a6cc6b8a7326639e83303cf1320c6c50d76517c17d42bcf45f6240a","src/unix/linux_like/linux/musl/b32/mod.rs":"7b3d9dfd8605b00bb9b5fa1439abe5ebf60199c7fa033eee555e8d181e93ffa2","src/unix/linux_like/linux/musl/b32/powerpc.rs":"c957d99a4d4371d2411a5769be8cf344516bf9ddc1011f977501a4eb57cb4e82","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"698f77bfcc838f82126c54f7387881fe3e89490117e5a4f333d1b4433823a672","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"199a91e90b454f9dc32770d5204cc4f6e5b8f144e0e34a1c91829949d6e804b3","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"9c4878df0fea0e0affd85346e0bc191abdc5e41e74dc9199b5644ec33d29c300","src/unix/linux_like/linux/musl/b64/mips64.rs":"1fa4974fe412b22c3555d3e240dbf00cc04a5287c751035ddf08a0470d4a7c9a","src/unix/linux_like/linux/musl/b64/mod.rs":"8c10627bd582cb272514e7350ae4743a65d489356eae039d2e7e55cd533fbbc8","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"36694cbdcdc33879e00502d55cb95eaa0096d213538993dd39c3da800cdd06d1","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"36621aca8ecf714f8dd42662dc2997833d95b9f129ef8c220503362e21efd695","src/unix/linux_like/linux/musl/b64/s390x.rs":"c7ebabc4e1bdbbd97e5065faa3a57f41f473570920582d979f9e9d4f77448546","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"238789097a26abc8b7cd578ed1a8e6cb8672083054303902781983902cd66854","src/unix/linux_like/linux/musl/mod.rs":"c3365480375bc258ffe267e7a299d7b3bb542a908bef8881f503ddc25ba8fc1f","src/unix/linux_like/linux/no_align.rs":"da2a8721becaaaa528781f97f5d9aae6a982ae5d4f5f6d2ffc0150bed72319b3","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"a056bbf718ddd775519058706bdb4909b56e6256985869e3c3132aa8ec5faca0","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"b84def53a49587e87f884c2bc28b21b290463b00b52e1d0309f2ba233a5b4a99","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"256a428290a560163ef7dc7d18b27bd3c6ce9748a0f28d5dc7f82203ee228220","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"367ec5483ad317e6ccba1ac0888da6cf088a8d32689214cc8d16129aa692260c","src/unix/linux_like/linux/uclibc/mod.rs":"1c3d25cddcfefa2bd17bdc81550826be31a08eef235e13f825f169a5029c8bca","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"024eba5753e852dbdd212427351affe7e83f9916c1864bce414d7aa2618f192e","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"bf6985e901041a61e90ccee1296b35a4c62ef90aa528d31989e1d647f072e79a","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"09fa012e027bfcdaabee221c1b676804a9c7e0e04a4b64fdd98a50c9b5c2f674","src/unix/mod.rs":"fbd5520d160a32a127608cd408905febe387773bbf05bfe199ef385fb5562e9c","src/unix/newlib/aarch64/mod.rs":"bac93836a9a57b2c710f32f852e92a4d11ad6759ab0fb6ad33e71d60e53278af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cbba6b3e957eceb496806e60de8725a23ff3fa0015983b4b4fa27b233732b526","src/unix/newlib/espidf/mod.rs":"816f235f4aa4baabba7f2606b31d0fdb03988c52194c966728de8690bf17299d","src/unix/newlib/generic.rs":"eab066d9f0a0f3eb53cc1073d01496bba0110989e1f6a59838afd19f870cd599","src/unix/newlib/horizon/mod.rs":"7cc5cc120437421db139bfa6a90b18168cd3070bdd0f5be96d40fe4c996f3ca1","src/unix/newlib/mod.rs":"54633d606e4e0413274af0b5beb5e697e6c061b63feaa0704b026554cc9d9c3e","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"0202ffd57caf75b6afa2c9717750ffb96e375ac33df0ae9609a3f831be393b67","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"033768cb273daf2c8090d97252c2de9dba6809e6a5d2457f5727d724807695db","src/unix/solarish/compat.rs":"b07a5bfac925eb012003a459ba6bddbd3bfa9c44b3394da2ac5a602e54beae9c","src/unix/solarish/illumos.rs":"29387916ee7dc58f07478746024003215e631cd30953e8fa2a5c415f81839007","src/unix/solarish/mod.rs":"8914a68865af026c1f4fb1d5f02ba0053362ef34b813ad60cc4aa3a88aa4999e","src/unix/solarish/solaris.rs":"65b005453aefa9b9d4fc860fe77cfec80d8c97a51342b15daf55fc3e808bb384","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"9074e813949f3c613afeac39d4118fb942c0b3c476232fc536489357cff5790f","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"aea3da66f2140f2a82dfc9c58f6e6531d2dd9c15ea696e0f95a0d4a2a187b5b6","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"4fae202af0327d768ed9e1b586b75816cce14fe2dc16947d2f3d381f209a54c1","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"090dd8fcd951d18f1905bca96188783c2e3f1433484926ecdcda144237ecec0f","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"} \ No newline at end of file +{"files":{"CONTRIBUTING.md":"752eea5a703d11b485c6b5f195f51bd2c79aa5159b619ce09555c779e1fb586b","Cargo.toml":"6a0abcfcbc1d9fb00a356343043a161f5b84b3f780cb0f02df4627d022b14b7f","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"8228847944f1332882fbb00275b6f30e4a8aad08a13569c25d52cac012cc2a47","build.rs":"41f9743021d9e5ed74ede55c94057cf6867a322a13b25a5d524b966656a08e38","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"bc8c46531bd1a2429f36aaf2bc137b50e42505b798de83f34eecfa94ad89179b","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"3f13d5f9b29d8969dde507661f1637524e21fe3bd34957fc778868f2f3713c46","src/macros.rs":"d7437c2573c4915768ff96b34710a61ee9f63622b23526cddeaeaf6bfb4751a2","src/psp.rs":"dd31aabd46171d474ec5828372e28588935120e7355c90c105360d8fa9264c1c","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"2eaf0f561a32bdcbf4e0477c8895d5e7bcb5cdebd5fef7b4df2ca8e38e144d94","src/unix/bsd/apple/b64/aarch64/mod.rs":"a3f0dfff62d0f7f4f1b5f9a4e2b662acf233a46badbc5419d3cc2d735629a710","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/mod.rs":"d7155927fbd1af6dd984a4c6c1a735a5932af828c96818209487eb6ae72d7d7e","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"379302e12d30807a1f973c4e2dd2205179d95343ee6fae05f33c9ed45a342799","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"2a215bd6136b8617aacedf9be738ccee94da9d29b418e9a78101d6291c182352","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"a6eee615e6ca5a6e04b526bb6b22d13b9356e87e51825cda33476c37a46cb0ef","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"755dafaf3f0945e798c34ea94c48e8552804ce60e2a15a4f0649f9d1aceaf422","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"cc65a73b0fa95a77044a4b3ee76d6eceb9773b55aea7d73bdf070e6f66e9ea38","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"0ed92eb93e78299cd7de0ae9daebb04a53b3c2d5e6a078e1fcd977f2a86bffc3","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/mod.rs":"467b66843ab8c1a54b01ae9e90aaf0295b32f54decbdfb64caca84523b488925","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"8f591bd273464d684c4f64365f8ed56a8138175daa70d96008541393057a0dae","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"a7345cc3fb7372572efe06848feb2cc246dfc2c2a0cc9ccf434f4c55041a59fa","src/unix/bsd/mod.rs":"7720ec82c9334f988ec4b271784768a017c3dc2e6dfae4d02418eef753388aa7","src/unix/bsd/netbsdlike/mod.rs":"594a0f9e23c4d7702ba38afdba5a0e866be25d692ec0afd66e04d939aa6b3f04","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"65dcb58d11e8d8028401a9d07ca3eb4cb4f053e04249cc877353449d84ccc4cb","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"cb1560bf8ffcc7b2726a27b433efac90e726292960626f3064bd2c6b7f861a55","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"1afe5ef46b14397cdd68664b5b232e4f5b035b6db1d4cf411c899d51ebca9f30","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"816a8ef47df60a752a91967627eeccb9ca776dc718ecc53ae902d8edaee0bce9","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"d5833ff9b94daa81d2470df544453212af17530d78c5a7fb912eac915d00f329","src/unix/haiku/native.rs":"dbfcbf4954a79d1df2ff58e0590bbcb8c57dfc7a32392aa73ee4726b66bd6cc8","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"859814f5df89e28fd4b345db399d181e11e7ed413841b6ff703a1fcbdbf013ae","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"433c1530f602cc5ed26610c58055dde0c4ceea5e00150063b24ddc60768332a4","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"8388bd3a0fcb5636bf965eee6dc95ae6860b85a2b555b387c868aa4d4e01ec89","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"ef230d49fd0d182adf2dae6f8e10babf18d72259d65980bf1c4c2dc8a4f84501","src/unix/linux_like/android/b64/mod.rs":"d7bbbadafdb2cb2ff8e9cde3d89a03b9facaabb6b2d45705225d3ece1c5cce37","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"6454948ea98be86243229f99d67cdc7ca460e16b2a6445663ff4b5b6907c358d","src/unix/linux_like/android/mod.rs":"1247397a7e1b6269e0d2d6df88c6396bc18eb477e3ff293ff57d66a6b1380d94","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"b71d37106750f57bc2dae4e9bcb473ff098ef48235827e41a1687a39825f0aa4","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"d6c259942c8e843373accd180fc8f4f45f03544dfd21b93a8d02641ead3ef63e","src/unix/linux_like/linux/arch/generic/mod.rs":"e20013ed91edcfb7f84f3f9f5a9ef827fd5c406e24b65989d8438da332236ef6","src/unix/linux_like/linux/arch/mips/mod.rs":"2d166054a586bb4bf6e4a4ba35f7574907b217225eff8f1a43adc4277e142460","src/unix/linux_like/linux/arch/mod.rs":"466a29622e47c6c7f1500682b2eb17f5566dd81b322cd6348f0fdd355cec593a","src/unix/linux_like/linux/arch/powerpc/mod.rs":"3f6da7b0fa7b394c7d4eea2bb3caa7a7729ab0d6c1491fef02206a912c41b815","src/unix/linux_like/linux/arch/sparc/mod.rs":"91593ec0440f1dd8f8e612028f432c44c14089286e2aca50e10511ab942db8c3","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"92ea7edc0e24f79dfbf5e3efc2d7509bed230562036e6aa85ef4f2c8088ecc8f","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"a2a0a9400dae44086ebf579e0448e0676d4a3214d1ae7d13a024857251e23b6b","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"0d7849eb2435ec1f49b6774872a0518f0129c50f37c9d38b37b1535722777a22","src/unix/linux_like/linux/gnu/b32/mod.rs":"8da281da578cdee972e952b118b903b370320897a7e335342a15e1359864bef2","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"049d6211ba4a9304bd4497c160bc21ae847c24e0528dd9d76263f16192e6aff5","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"a4256148cec0bb672c8dfa605866930d9761af9655721de72ae41eeeb8fdbf6d","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"525618615aa0cb80c6c90860bf579dfed8db307fffd56b97dc235fb945419434","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"78b4038852986436888c63be9258037cf642124daee9d5fa5cef2bf8e412bf54","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"21a21503ef2e095f4371044915d4bfb07a8578011cb5c713cd9f45947b0b5730","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"e78c3cd197f44832338b414d1a9bc0d194f44c74db77bd7bf830c1fff62b2690","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"c4e20b1c63d7a03a6e22aef2046689ef95cc4651011ade7cb94176fcea1dc252","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"387808d5398b24339e7e2bf7591150735011befc5b421fa713d7017c04a7b1da","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"17aad16329431d83e1909e3a08022f6e28f4bcba7dec4a967fe1a321a6a43b99","src/unix/linux_like/linux/gnu/b64/mod.rs":"3c6555f30a7a8852757b31a542ea73fb6a16a6e27e838397e819278ad56e57a4","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"97e0ecf11ecce793a13fec39654fb513c5479edf7faa7a276fa714b61993d0fc","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"b3fe290afe63d2d6e315d0cf1f775464e9c1f2a1906d243c1af74a137a4031cb","src/unix/linux_like/linux/gnu/b64/s390x.rs":"254f00266ecf9644a4b469457cb37c4dd6c055820926c1de0fb9035b6048e75c","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"87dd7f3d5bf3c09f4064ec738e306cc9cc41ad49b4a5df62c5983301c3bbf99a","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"1b939aaf3cdf3efc7d3bd53e83e80235530d3ba0c24bb7611d4730d35d457ec1","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"b88ef8a1eaa9ed73bf2acb8192afb73af987a92abb94140c6376fc83f2fa5553","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"79305936a60d342efdc10519ba89507d6b48e65f13f33090d3b04dc9655ceed0","src/unix/linux_like/linux/gnu/mod.rs":"84ad4a663b5fa2498179be8dca96fef5f0446ec1619215ac674424ee394e307d","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"cff23db1e0bac8c30052dfed5e89e65bc207471e4bfb3a6fa0a4df62ed9e413e","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"e5faee8efda8a225ea0b17d4d6f9e893a678e73773fa62c549a8e19c106b9f04","src/unix/linux_like/linux/musl/b32/hexagon.rs":"226a8b64ce9c75abbbee6d2dceb0b44f7b6c750c4102ebd4d015194afee6666e","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"df8f8b529a6cc6b8a7326639e83303cf1320c6c50d76517c17d42bcf45f6240a","src/unix/linux_like/linux/musl/b32/mod.rs":"7b3d9dfd8605b00bb9b5fa1439abe5ebf60199c7fa033eee555e8d181e93ffa2","src/unix/linux_like/linux/musl/b32/powerpc.rs":"c957d99a4d4371d2411a5769be8cf344516bf9ddc1011f977501a4eb57cb4e82","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"698f77bfcc838f82126c54f7387881fe3e89490117e5a4f333d1b4433823a672","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"199a91e90b454f9dc32770d5204cc4f6e5b8f144e0e34a1c91829949d6e804b3","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"798a9229d70ce235394f2dd625f6c4c1e10519a94382dc5b091952b638ae2928","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"9c4878df0fea0e0affd85346e0bc191abdc5e41e74dc9199b5644ec33d29c300","src/unix/linux_like/linux/musl/b64/mips64.rs":"3686fc8cb2e311cda8e6b96f6dfe90b65a366714bd480312b692b1a6ca1241b6","src/unix/linux_like/linux/musl/b64/mod.rs":"8c10627bd582cb272514e7350ae4743a65d489356eae039d2e7e55cd533fbbc8","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"36694cbdcdc33879e00502d55cb95eaa0096d213538993dd39c3da800cdd06d1","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"36621aca8ecf714f8dd42662dc2997833d95b9f129ef8c220503362e21efd695","src/unix/linux_like/linux/musl/b64/s390x.rs":"9b05b1fae6bcb7cb6d909b9973977fde01684175f3e26c27dcb44223cc3933d9","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"238789097a26abc8b7cd578ed1a8e6cb8672083054303902781983902cd66854","src/unix/linux_like/linux/musl/mod.rs":"2efe98b8166270be1624888953fa07da06f08313f15bf4c7dc2eba63f5a790a5","src/unix/linux_like/linux/no_align.rs":"da2a8721becaaaa528781f97f5d9aae6a982ae5d4f5f6d2ffc0150bed72319b3","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"a056bbf718ddd775519058706bdb4909b56e6256985869e3c3132aa8ec5faca0","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"b84def53a49587e87f884c2bc28b21b290463b00b52e1d0309f2ba233a5b4a99","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"256a428290a560163ef7dc7d18b27bd3c6ce9748a0f28d5dc7f82203ee228220","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"367ec5483ad317e6ccba1ac0888da6cf088a8d32689214cc8d16129aa692260c","src/unix/linux_like/linux/uclibc/mod.rs":"ddd223d4f574b2b92072bbdab091f12d8d89d5e05f41076ddfa6bc6af379698f","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"024eba5753e852dbdd212427351affe7e83f9916c1864bce414d7aa2618f192e","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"bf6985e901041a61e90ccee1296b35a4c62ef90aa528d31989e1d647f072e79a","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"dd4f7a1d66d8501b4a2c4e75e6e9305ed69f1002ae99e410596a6c636878595a","src/unix/mod.rs":"d1b4ba41f9b9c106f6ba8c661b5808824b774a7a7caac7d8938bf50979ba5195","src/unix/newlib/aarch64/mod.rs":"bac93836a9a57b2c710f32f852e92a4d11ad6759ab0fb6ad33e71d60e53278af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cbba6b3e957eceb496806e60de8725a23ff3fa0015983b4b4fa27b233732b526","src/unix/newlib/espidf/mod.rs":"ff9c13e99d84912f5ebe75b7a7ea9c1e9d8f35a268716081e09899c7ea822bc6","src/unix/newlib/generic.rs":"eab066d9f0a0f3eb53cc1073d01496bba0110989e1f6a59838afd19f870cd599","src/unix/newlib/horizon/mod.rs":"7cc5cc120437421db139bfa6a90b18168cd3070bdd0f5be96d40fe4c996f3ca1","src/unix/newlib/mod.rs":"54633d606e4e0413274af0b5beb5e697e6c061b63feaa0704b026554cc9d9c3e","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"0202ffd57caf75b6afa2c9717750ffb96e375ac33df0ae9609a3f831be393b67","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"033768cb273daf2c8090d97252c2de9dba6809e6a5d2457f5727d724807695db","src/unix/solarish/compat.rs":"b07a5bfac925eb012003a459ba6bddbd3bfa9c44b3394da2ac5a602e54beae9c","src/unix/solarish/illumos.rs":"29387916ee7dc58f07478746024003215e631cd30953e8fa2a5c415f81839007","src/unix/solarish/mod.rs":"976b07a13e195840b67c166a62318abfa9ffc8d5ebbb0358f199dd213ec98d1b","src/unix/solarish/solaris.rs":"65b005453aefa9b9d4fc860fe77cfec80d8c97a51342b15daf55fc3e808bb384","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"9074e813949f3c613afeac39d4118fb942c0b3c476232fc536489357cff5790f","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"aea3da66f2140f2a82dfc9c58f6e6531d2dd9c15ea696e0f95a0d4a2a187b5b6","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"4fae202af0327d768ed9e1b586b75816cce14fe2dc16947d2f3d381f209a54c1","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"e3ad95ba54f76e74c301611fe868d3d94f6b8939b03be672f568b06b10ae71c7","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"} \ No newline at end of file diff --git a/bash-5.1/vendor/libc/CONTRIBUTING.md b/bash-5.1/vendor/libc/CONTRIBUTING.md index 3315ed3e84f7ea687393b11760cd14127ad9f7f2..5be6eb9be4a22e56399ca9d1d976b91ffdd00b34 100644 --- a/bash-5.1/vendor/libc/CONTRIBUTING.md +++ b/bash-5.1/vendor/libc/CONTRIBUTING.md @@ -72,10 +72,6 @@ after a certain period. The steps are: If you're using it, please comment on #XXX"). 2. If we don't see any concerns for a while, do the change actually. -## Supported target policy - -When Rust removes a support for a target, the libc crate also may remove the support anytime. - ## Releasing your change to crates.io Now that you've done the amazing job of landing your new API or your new diff --git a/bash-5.1/vendor/libc/Cargo.toml b/bash-5.1/vendor/libc/Cargo.toml index 5b54eced6084468583f80a32da187b2f791cbbed..7983d029f49ccb2f7f29018d60b4b8de737b35f6 100644 --- a/bash-5.1/vendor/libc/Cargo.toml +++ b/bash-5.1/vendor/libc/Cargo.toml @@ -11,7 +11,7 @@ [package] name = "libc" -version = "0.2.132" +version = "0.2.126" authors = ["The Rust Project Developers"] build = "build.rs" exclude = [ diff --git a/bash-5.1/vendor/libc/README.md b/bash-5.1/vendor/libc/README.md index bc5ad18f6b1b85f05632b6a78a840e2a1e747d44..a8a3afd9f6cf2d3cc014f2c680db9697870d067a 100644 --- a/bash-5.1/vendor/libc/README.md +++ b/bash-5.1/vendor/libc/README.md @@ -35,16 +35,13 @@ libc = "0.2" This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`. * `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s. - If you use Rust >= 1.62, this feature is implicitly enabled. - Otherwise it requires a nightly rustc. + This feature requires a nightly rustc. * **deprecated**: `use_std` is deprecated, and is equivalent to `std`. ## Rust version support -The minimum supported Rust toolchain version is currently **Rust 1.13.0**. -(libc does not currently have any policy regarding changes to the minimum -supported Rust version; such policy is a work in progress.) APIs requiring +The minimum supported Rust toolchain version is **Rust 1.13.0** . APIs requiring newer Rust features are only available on newer Rust toolchains: | Feature | Version | @@ -56,7 +53,6 @@ newer Rust features are only available on newer Rust toolchains: | `core::ffi::c_void` | 1.30.0 | | `repr(packed(N))` | 1.33.0 | | `cfg(target_vendor)` | 1.33.0 | -| `const-extern-fn` | 1.62.0 | ## Platform support diff --git a/bash-5.1/vendor/libc/build.rs b/bash-5.1/vendor/libc/build.rs index 0a43b2a12ea968986fcc50a11ba21a11ae9b19b2..bc7b77f25e97d817bb2efb8816dd43294f694185 100644 --- a/bash-5.1/vendor/libc/build.rs +++ b/bash-5.1/vendor/libc/build.rs @@ -97,18 +97,11 @@ fn main() { println!("cargo:rustc-cfg=libc_thread_local"); } - // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C". - if rustc_minor_ver >= 62 { - println!("cargo:rustc-cfg=libc_const_extern_fn"); - } else { - // Rust < 1.62.0 requires a crate feature and feature gate. - if const_extern_fn_cargo_feature { - if !is_nightly || rustc_minor_ver < 40 { - panic!("const-extern-fn requires a nightly compiler >= 1.40"); - } - println!("cargo:rustc-cfg=libc_const_extern_fn_unstable"); - println!("cargo:rustc-cfg=libc_const_extern_fn"); + if const_extern_fn_cargo_feature { + if !is_nightly || rustc_minor_ver < 40 { + panic!("const-extern-fn requires a nightly compiler >= 1.40") } + println!("cargo:rustc-cfg=libc_const_extern_fn"); } } diff --git a/bash-5.1/vendor/libc/src/fuchsia/mod.rs b/bash-5.1/vendor/libc/src/fuchsia/mod.rs index 4a18a8daabc0c63187d9107d1eaa19abe776e0e6..99b7791b0a492098d1e5a8fd9093c5b9081a1caa 100644 --- a/bash-5.1/vendor/libc/src/fuchsia/mod.rs +++ b/bash-5.1/vendor/libc/src/fuchsia/mod.rs @@ -877,11 +877,6 @@ s! { pub c_ispeed: ::speed_t, pub c_ospeed: ::speed_t, } - - pub struct in6_pktinfo { - pub ipi6_addr: ::in6_addr, - pub ipi6_ifindex: ::c_uint, - } } s_no_extra_traits! { @@ -1793,9 +1788,6 @@ pub const IPV6_MULTICAST_LOOP: ::c_int = 19; pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; pub const IPV6_V6ONLY: ::c_int = 26; -pub const IPV6_RECVPKTINFO: ::c_int = 49; -pub const IPV6_RECVTCLASS: ::c_int = 66; -pub const IPV6_TCLASS: ::c_int = 67; pub const TCP_NODELAY: ::c_int = 1; pub const TCP_MAXSEG: ::c_int = 2; @@ -2677,9 +2669,6 @@ pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; pub const PT_GNU_STACK: u32 = 0x6474e551; pub const PT_GNU_RELRO: u32 = 0x6474e552; -// Ethernet protocol IDs. -pub const ETH_P_IP: ::c_int = 0x0800; - pub const SFD_CLOEXEC: ::c_int = 0x080000; pub const NCCS: usize = 32; diff --git a/bash-5.1/vendor/libc/src/lib.rs b/bash-5.1/vendor/libc/src/lib.rs index acda0915920255a9d1b9eed440fa512775df8b12..d87d0d8e1c91aa18a8a9ef455e1555d0771381dc 100644 --- a/bash-5.1/vendor/libc/src/lib.rs +++ b/bash-5.1/vendor/libc/src/lib.rs @@ -13,9 +13,7 @@ improper_ctypes, // This lint is renamed but we run CI for old stable rustc so should be here. redundant_semicolon, - redundant_semicolons, - unused_macros, - unused_macro_rules, + redundant_semicolons )] #![cfg_attr(libc_deny_warnings, deny(warnings))] // Attributes needed when building as part of the standard library @@ -26,7 +24,11 @@ #![deny(missing_copy_implementations, safe_packed_borrows)] #![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] #![cfg_attr(feature = "rustc-dep-of-std", no_core)] -#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))] +#![cfg_attr( + feature = "rustc-dep-of-std", + feature(native_link_modifiers, native_link_modifiers_bundle) +)] +#![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))] #[macro_use] mod macros; diff --git a/bash-5.1/vendor/libc/src/macros.rs b/bash-5.1/vendor/libc/src/macros.rs index fd473702f72bd8054d207c5b1960ab67df833411..603fa583e5fa971470e13790a4d0a6a24e38e88a 100644 --- a/bash-5.1/vendor/libc/src/macros.rs +++ b/bash-5.1/vendor/libc/src/macros.rs @@ -6,6 +6,7 @@ /// /// This allows you to conveniently provide a long list #[cfg]'d blocks of code /// without having to rewrite each clause multiple times. +#[allow(unused_macros)] macro_rules! cfg_if { // match if/else chains with a final `else` ($( @@ -61,6 +62,7 @@ macro_rules! cfg_if { }; } +#[allow(unused_macros, unused_macro_rules)] macro_rules! s { ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($( s!(it: $(#[$attr])* pub $t $i { $($field)* }); @@ -85,6 +87,7 @@ macro_rules! s { ); } +#[allow(unused_macros)] macro_rules! s_no_extra_traits { ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($( s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* }); @@ -120,6 +123,7 @@ macro_rules! s_no_extra_traits { ); } +#[allow(unused_macros)] macro_rules! e { ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($( __item! { @@ -134,6 +138,7 @@ macro_rules! e { )*); } +#[allow(unused_macros)] macro_rules! s_paren { ($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($( __item! { @@ -177,6 +182,7 @@ macro_rules! s_paren { // 'f!' block cfg_if! { if #[cfg(libc_const_extern_fn)] { + #[allow(unused_macros)] macro_rules! f { ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -192,6 +198,7 @@ cfg_if! { )*) } + #[allow(unused_macros)] macro_rules! safe_f { ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -207,6 +214,7 @@ cfg_if! { )*) } + #[allow(unused_macros)] macro_rules! const_fn { ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -223,6 +231,7 @@ cfg_if! { } } else { + #[allow(unused_macros)] macro_rules! f { ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -238,6 +247,7 @@ cfg_if! { )*) } + #[allow(unused_macros)] macro_rules! safe_f { ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -253,6 +263,7 @@ cfg_if! { )*) } + #[allow(unused_macros)] macro_rules! const_fn { ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident( $($arg:ident: $argty:ty),* @@ -270,12 +281,14 @@ cfg_if! { } } +#[allow(unused_macros)] macro_rules! __item { ($i:item) => { $i }; } +#[allow(unused_macros)] macro_rules! align_const { ($($(#[$attr:meta])* pub const $name:ident : $t1:ty @@ -295,6 +308,7 @@ macro_rules! align_const { } // This macro is used to deprecate items that should be accessed via the mach2 crate +#[allow(unused_macros)] macro_rules! deprecated_mach { (pub const $id:ident: $ty:ty = $expr:expr;) => { #[deprecated( @@ -328,6 +342,7 @@ macro_rules! deprecated_mach { } } +#[allow(unused_macros)] #[cfg(not(libc_ptr_addr_of))] macro_rules! ptr_addr_of { ($place:expr) => { @@ -335,6 +350,7 @@ macro_rules! ptr_addr_of { }; } +#[allow(unused_macros)] #[cfg(libc_ptr_addr_of)] macro_rules! ptr_addr_of { ($place:expr) => { diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs index 29db97ec7c473780180da5b7296ee8f605e4cb7b..131e15b69ad9454c31a68a50916dbd63d19c7d93 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs @@ -15,7 +15,6 @@ s! { pub uc_link: *mut ::ucontext_t, pub uc_mcsize: usize, pub uc_mcontext: mcontext_t, - __mcontext_data: __darwin_mcontext64, } pub struct __darwin_mcontext64 { diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs index a831ca850f4beed42e0c157dc8a305bb33783191..bd69d8aaaf04cfe1ebb2ca0a5b3d783e0093d0d7 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs @@ -53,8 +53,6 @@ pub type host_info64_t = *mut integer_t; pub type processor_flavor_t = ::c_int; pub type thread_flavor_t = natural_t; pub type thread_inspect_t = ::mach_port_t; -pub type thread_act_t = ::mach_port_t; -pub type thread_act_array_t = *mut ::thread_act_t; pub type policy_t = ::c_int; pub type mach_vm_address_t = u64; pub type mach_vm_offset_t = u64; @@ -66,9 +64,6 @@ pub type memory_object_offset_t = ::c_ulonglong; pub type vm_inherit_t = ::c_uint; pub type vm_prot_t = ::c_int; -pub type ledger_t = ::mach_port_t; -pub type ledger_array_t = *mut ::ledger_t; - pub type iconv_t = *mut ::c_void; pub type processor_cpu_load_info_t = *mut processor_cpu_load_info; @@ -126,7 +121,6 @@ pub type vm_statistics64_t = *mut vm_statistics64; pub type vm_statistics64_data_t = vm_statistics64; pub type task_t = ::mach_port_t; -pub type task_inspect_t = ::mach_port_t; pub type sysdir_search_path_enumeration_state = ::c_uint; @@ -678,13 +672,6 @@ s! { pub s_addr: ::in_addr_t, } - // net/ndrv.h - pub struct sockaddr_ndrv { - pub snd_len: ::c_uchar, - pub snd_family: ::c_uchar, - pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h - } - // sys/socket.h pub struct sa_endpoints_t { @@ -1051,8 +1038,7 @@ s_no_extra_traits! { pub f_fstypename: [::c_char; 16], pub f_mntonname: [::c_char; 1024], pub f_mntfromname: [::c_char; 1024], - pub f_flags_ext: u32, - pub f_reserved: [u32; 7], + pub f_reserved: [u32; 8], } pub struct dirent { @@ -3480,7 +3466,6 @@ pub const pseudo_AF_RTIP: ::c_int = 22; pub const AF_IPX: ::c_int = 23; pub const AF_SIP: ::c_int = 24; pub const pseudo_AF_PIP: ::c_int = 25; -pub const AF_NDRV: ::c_int = 27; pub const AF_ISDN: ::c_int = 28; pub const AF_E164: ::c_int = AF_ISDN; pub const pseudo_AF_KEY: ::c_int = 29; @@ -3523,7 +3508,6 @@ pub const PF_SIP: ::c_int = AF_SIP; pub const PF_IPX: ::c_int = AF_IPX; pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; pub const PF_PIP: ::c_int = pseudo_AF_PIP; -pub const PF_NDRV: ::c_int = AF_NDRV; pub const PF_ISDN: ::c_int = AF_ISDN; pub const PF_KEY: ::c_int = pseudo_AF_KEY; pub const PF_INET6: ::c_int = AF_INET6; @@ -3568,7 +3552,6 @@ pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70; pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71; pub const IP_BLOCK_SOURCE: ::c_int = 72; pub const IP_UNBLOCK_SOURCE: ::c_int = 73; -pub const IPV6_BOUND_IF: ::c_int = 125; pub const TCP_NOPUSH: ::c_int = 4; pub const TCP_NOOPT: ::c_int = 8; @@ -4689,16 +4672,6 @@ cfg_if! { const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 } - } else { - fn __DARWIN_ALIGN32(p: usize) -> usize { - let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; - p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 - } - } -} - -cfg_if! { - if #[cfg(libc_const_size_of)] { pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = (::mem::size_of::() / ::mem::size_of::()) as mach_msg_type_number_t; @@ -4739,6 +4712,10 @@ cfg_if! { (::mem::size_of::() / ::mem::size_of::()) as mach_msg_type_number_t; } else { + fn __DARWIN_ALIGN32(p: usize) -> usize { + let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; + p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 + } pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1; pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4; pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1; @@ -5027,8 +5004,6 @@ extern "C" { thread_info_out: thread_info_t, thread_info_outCnt: *mut mach_msg_type_number_t, ) -> kern_return_t; - #[cfg_attr(doc, doc(alias = "__errno_location"))] - #[cfg_attr(doc, doc(alias = "errno"))] pub fn __error() -> *mut ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char; @@ -5505,19 +5480,6 @@ extern "C" { task_info_out: task_info_t, task_info_count: *mut mach_msg_type_number_t, ) -> ::kern_return_t; - pub fn task_create( - target_task: ::task_t, - ledgers: ::ledger_array_t, - ledgersCnt: ::mach_msg_type_number_t, - inherit_memory: ::boolean_t, - child_task: *mut ::task_t, - ) -> ::kern_return_t; - pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t; - pub fn task_threads( - target_task: ::task_inspect_t, - act_list: *mut ::thread_act_array_t, - act_listCnt: *mut ::mach_msg_type_number_t, - ) -> ::kern_return_t; pub fn host_statistics( host_priv: host_t, flavor: host_flavor_t, @@ -5546,23 +5508,12 @@ cfg_if! { if #[cfg(target_os = "macos")] { extern "C" { pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; - } - } -} -cfg_if! { - if #[cfg(any(target_os = "macos", target_os = "ios"))] { - extern "C" { pub fn memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void; - pub fn task_set_info(target_task: ::task_t, - flavor: ::task_flavor_t, - task_info_in: ::task_info_t, - task_info_inCnt: ::mach_msg_type_number_t - ) -> ::kern_return_t; } } } diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs index df7719b4b9c698cfd93434304840a598d3e1f734..d56362816a275b1d3435834394aa3d7bb64ffb7f 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -34,17 +34,6 @@ pub type pthread_spinlock_t = ::uintptr_t; pub type segsz_t = usize; -pub type vm_prot_t = u8; -pub type vm_maptype_t = u8; -pub type vm_inherit_t = i8; -pub type vm_subsys_t = ::c_int; -pub type vm_eflags_t = ::c_uint; - -pub type vm_map_t = *mut __c_anonymous_vm_map; -pub type vm_map_entry_t = *mut vm_map_entry; - -pub type pmap = __c_anonymous_pmap; - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum sem {} impl ::Copy for sem {} @@ -347,50 +336,6 @@ s! { kp_spare: [::c_int; 2], } - pub struct __c_anonymous_vm_map { - _priv: [::uintptr_t; 36], - } - - pub struct vm_map_entry { - _priv: [::uintptr_t; 15], - pub eflags: ::vm_eflags_t, - pub maptype: ::vm_maptype_t, - pub protection: ::vm_prot_t, - pub max_protection: ::vm_prot_t, - pub inheritance: ::vm_inherit_t, - pub wired_count: ::c_int, - pub id: ::vm_subsys_t, - } - - pub struct __c_anonymous_pmap { - _priv1: [::uintptr_t; 32], - _priv2: [::uintptr_t; 32], - _priv3: [::uintptr_t; 32], - _priv4: [::uintptr_t; 32], - _priv5: [::uintptr_t; 8], - } - - pub struct vmspace { - vm_map: __c_anonymous_vm_map, - vm_pmap: __c_anonymous_pmap, - pub vm_flags: ::c_int, - pub vm_shm: *mut ::c_char, - pub vm_rssize: ::segsz_t, - pub vm_swrss: ::segsz_t, - pub vm_tsize: ::segsz_t, - pub vm_dsize: ::segsz_t, - pub vm_ssize: ::segsz_t, - pub vm_taddr: *mut ::c_char, - pub vm_daddr: *mut ::c_char, - pub vm_maxsaddr: *mut ::c_char, - pub vm_minsaddr: *mut ::c_char, - _unused1: ::c_int, - _unused2: ::c_int, - pub vm_pagesupply: ::c_int, - pub vm_holdcnt: ::c_uint, - pub vm_refcnt: ::c_uint, - } - pub struct cpuctl_msr_args_t { pub msr: ::c_int, pub data: u64, @@ -1668,20 +1613,6 @@ extern "C" { pub fn freezero(ptr: *mut ::c_void, size: ::size_t); } -#[link(name = "kvm")] -extern "C" { - pub fn kvm_vm_map_entry_first( - kvm: *mut ::kvm_t, - map: vm_map_t, - entry: vm_map_entry_t, - ) -> vm_map_entry_t; - pub fn kvm_vm_map_entry_next( - kvm: *mut ::kvm_t, - map: vm_map_entry_t, - entry: vm_map_entry_t, - ) -> vm_map_entry_t; -} - cfg_if! { if #[cfg(libc_thread_local)] { mod errno; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index 84e43b23e522912a710ab032f5b7f4ba51b9f4ef..8d27d88605e5aef872efa2ceee1edfc8db22b2b7 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -44,6 +44,10 @@ pub type fhandle_t = fhandle; pub type au_id_t = ::uid_t; pub type au_asid_t = ::pid_t; +// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly, +// making the type definition system dependent. Better not bind it exactly. +pub type kvm_t = ::c_void; + #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] #[repr(u32)] pub enum devstat_support_flags { @@ -3657,19 +3661,6 @@ pub const CPUCLOCK_WHICH_TID: ::c_int = 1; pub const MFD_CLOEXEC: ::c_uint = 0x00000001; pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002; pub const MFD_HUGETLB: ::c_uint = 0x00000004; -pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000; -pub const MFD_HUGE_64KB: ::c_uint = 16 << 26; -pub const MFD_HUGE_512KB: ::c_uint = 19 << 26; -pub const MFD_HUGE_1MB: ::c_uint = 20 << 26; -pub const MFD_HUGE_2MB: ::c_uint = 21 << 26; -pub const MFD_HUGE_8MB: ::c_uint = 23 << 26; -pub const MFD_HUGE_16MB: ::c_uint = 24 << 26; -pub const MFD_HUGE_32MB: ::c_uint = 25 << 26; -pub const MFD_HUGE_256MB: ::c_uint = 28 << 26; -pub const MFD_HUGE_512MB: ::c_uint = 29 << 26; -pub const MFD_HUGE_1GB: ::c_uint = 30 << 26; -pub const MFD_HUGE_2GB: ::c_uint = 31 << 26; -pub const MFD_HUGE_16GB: ::c_uint = 34 << 26; pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0; pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1; @@ -3781,21 +3772,21 @@ f! { } pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { - let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let bitset_bits = ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); cpuset.__bits[idx] |= 1 << offset; () } pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () { - let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let bitset_bits = ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); cpuset.__bits[idx] &= !(1 << offset); () } pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool { - let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let bitset_bits = ::mem::size_of::<::c_long>(); let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); 0 != cpuset.__bits[idx] & (1 << offset) } @@ -3803,9 +3794,9 @@ f! { pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int { let mut s: u32 = 0; let cpuset_size = ::mem::size_of::(); - let bitset_size = ::mem::size_of::<::c_long>(); + let bitset_bits = ::mem::size_of::<::c_long>(); - for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() { + for i in cpuset.__bits[..(cpuset_size / bitset_bits)].iter() { s += i.count_ones(); }; s as ::c_int @@ -3848,8 +3839,6 @@ cfg_if! { } extern "C" { - #[cfg_attr(doc, doc(alias = "__errno_location"))] - #[cfg_attr(doc, doc(alias = "errno"))] pub fn __error() -> *mut ::c_int; pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; @@ -4283,39 +4272,71 @@ extern "C" { #[link(name = "kvm")] extern "C" { - pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int; - pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) - -> *mut *mut ::c_char; - pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int; - pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) - -> *mut *mut ::c_char; - pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char; - pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int; - pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int; - pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void; - pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64; + pub fn kvm_open( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errstr: *const ::c_char, + ) -> *mut kvm_t; + pub fn kvm_close(kd: *mut kvm_t) -> ::c_int; + pub fn kvm_dpcpu_setcpu(kd: *mut kvm_t, cpu: ::c_uint) -> ::c_int; + pub fn kvm_getargv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char; + pub fn kvm_getcptime(kd: *mut kvm_t, cp_time: *mut ::c_long) -> ::c_int; + pub fn kvm_getenvv(kd: *mut kvm_t, p: *const kinfo_proc, nchr: ::c_int) -> *mut *mut ::c_char; + pub fn kvm_geterr(kd: *mut kvm_t) -> *mut ::c_char; + pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn kvm_getmaxcpu(kd: *mut kvm_t) -> ::c_int; + pub fn kvm_getncpus(kd: *mut kvm_t) -> ::c_int; + pub fn kvm_getpcpu(kd: *mut kvm_t, cpu: ::c_int) -> *mut ::c_void; + pub fn kvm_counter_u64_fetch(kd: *mut kvm_t, base: ::c_ulong) -> u64; + pub fn kvm_getprocs( + kd: *mut kvm_t, + op: ::c_int, + arg: ::c_int, + cnt: *mut ::c_int, + ) -> *mut kinfo_proc; pub fn kvm_getswapinfo( - kd: *mut ::kvm_t, + kd: *mut kvm_t, info: *mut kvm_swap, maxswap: ::c_int, flags: ::c_int, ) -> ::c_int; - pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int; - pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int; - pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int; + pub fn kvm_native(kd: *mut kvm_t) -> ::c_int; + pub fn kvm_nlist(kd: *mut kvm_t, nl: *mut nlist) -> ::c_int; + pub fn kvm_nlist2(kd: *mut kvm_t, nl: *mut kvm_nlist) -> ::c_int; + pub fn kvm_openfiles( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errbuf: *mut ::c_char, + ) -> *mut kvm_t; + pub fn kvm_read( + kd: *mut kvm_t, + addr: ::c_ulong, + buf: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; pub fn kvm_read_zpcpu( - kd: *mut ::kvm_t, + kd: *mut kvm_t, base: ::c_ulong, buf: *mut ::c_void, size: ::size_t, cpu: ::c_int, ) -> ::ssize_t; pub fn kvm_read2( - kd: *mut ::kvm_t, + kd: *mut kvm_t, addr: kvaddr_t, buf: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t; + pub fn kvm_write( + kd: *mut kvm_t, + addr: ::c_ulong, + buf: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; } #[link(name = "util")] @@ -4465,10 +4486,10 @@ extern "C" { #[link(name = "devstat")] extern "C" { - pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int; - pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long; - pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int; - pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_getnumdevs(kd: *mut kvm_t) -> ::c_int; + pub fn devstat_getgeneration(kd: *mut kvm_t) -> ::c_long; + pub fn devstat_getversion(kd: *mut kvm_t) -> ::c_int; + pub fn devstat_checkversion(kd: *mut kvm_t) -> ::c_int; pub fn devstat_selectdevs( dev_select: *mut *mut device_selection, num_selected: *mut ::c_int, diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs index b314b68568c84d54d19d98fc2fd23c014abae994..b9d29d8251bf68223987d02e89c7bc0d493efe32 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -35,10 +35,6 @@ pub type Elf64_Xword = u64; pub type iconv_t = *mut ::c_void; -// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly, -// making the type definition system dependent. Better not bind it exactly. -pub type kvm_t = ::c_void; - cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -1794,44 +1790,6 @@ extern "C" { ) -> ::c_int; } -#[link(name = "kvm")] -extern "C" { - pub fn kvm_open( - execfile: *const ::c_char, - corefile: *const ::c_char, - swapfile: *const ::c_char, - flags: ::c_int, - errstr: *const ::c_char, - ) -> *mut ::kvm_t; - pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int; - pub fn kvm_getprocs( - kd: *mut ::kvm_t, - op: ::c_int, - arg: ::c_int, - cnt: *mut ::c_int, - ) -> *mut ::kinfo_proc; - pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; - pub fn kvm_openfiles( - execfile: *const ::c_char, - corefile: *const ::c_char, - swapfile: *const ::c_char, - flags: ::c_int, - errbuf: *mut ::c_char, - ) -> *mut ::kvm_t; - pub fn kvm_read( - kd: *mut ::kvm_t, - addr: ::c_ulong, - buf: *mut ::c_void, - nbytes: ::size_t, - ) -> ::ssize_t; - pub fn kvm_write( - kd: *mut ::kvm_t, - addr: ::c_ulong, - buf: *const ::c_void, - nbytes: ::size_t, - ) -> ::ssize_t; -} - cfg_if! { if #[cfg(target_os = "freebsd")] { mod freebsd; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/mod.rs index 20e203bde37b04c4eb37432e31ee06ab653414ce..8ebca0930107a789f6daa5119000c98018511e42 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/mod.rs @@ -449,12 +449,6 @@ pub const TCP_MAXSEG: ::c_int = 2; pub const PIPE_BUF: usize = 512; -// si_code values for SIGBUS signal -pub const BUS_ADRALN: ::c_int = 1; -pub const BUS_ADRERR: ::c_int = 2; -pub const BUS_OBJERR: ::c_int = 3; - -// si_code values for SIGCHLD signal pub const CLD_EXITED: ::c_int = 1; pub const CLD_KILLED: ::c_int = 2; pub const CLD_DUMPED: ::c_int = 3; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs index a7f35ef8597300cbf14f5893e86812cc0301efec..d7d40bd97a69838c65ec74b6ad4ecc1cb2a9eb91 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs @@ -639,6 +639,17 @@ pub const TIOCM_DSR: ::c_int = 0o0400; pub const TIOCM_CD: ::c_int = TIOCM_CAR; pub const TIOCM_RI: ::c_int = TIOCM_RNG; +// Flags for chflags(2) +pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; +pub const UF_NODUMP: ::c_ulong = 0x00000001; +pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +pub const UF_APPEND: ::c_ulong = 0x00000004; +pub const UF_OPAQUE: ::c_ulong = 0x00000008; +pub const SF_SETTABLE: ::c_ulong = 0xffff0000; +pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +pub const SF_APPEND: ::c_ulong = 0x00040000; + pub const TIMER_ABSTIME: ::c_int = 1; #[link(name = "util")] diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index d12fd073019bee7fb4898686e42339c9500894f9..0afff1cd312e1d42962091758dc0725c024fddbf 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -487,134 +487,6 @@ s! { af_arg: [[::c_char; 10]; 24], } - pub struct ki_sigset_t { - pub __bits: [u32; 4], - } - - pub struct kinfo_proc2 { - pub p_forw: u64, - pub p_back: u64, - pub p_paddr: u64, - pub p_addr: u64, - pub p_fd: u64, - pub p_cwdi: u64, - pub p_stats: u64, - pub p_limit: u64, - pub p_vmspace: u64, - pub p_sigacts: u64, - pub p_sess: u64, - pub p_tsess: u64, - pub p_ru: u64, - pub p_eflag: i32, - pub p_exitsig: i32, - pub p_flag: i32, - pub p_pid: i32, - pub p_ppid: i32, - pub p_sid: i32, - pub p__pgid: i32, - pub p_tpgid: i32, - pub p_uid: u32, - pub p_ruid: u32, - pub p_gid: u32, - pub p_rgid: u32, - pub p_groups: [u32; KI_NGROUPS as usize], - pub p_ngroups: i16, - pub p_jobc: i16, - pub p_tdev: u32, - pub p_estcpu: u32, - pub p_rtime_sec: u32, - pub p_rtime_usec: u32, - pub p_cpticks: i32, - pub p_pctcpu: u32, - pub p_swtime: u32, - pub p_slptime: u32, - pub p_schedflags: i32, - pub p_uticks: u64, - pub p_sticks: u64, - pub p_iticks: u64, - pub p_tracep: u64, - pub p_traceflag: i32, - pub p_holdcnt: i32, - pub p_siglist: ki_sigset_t, - pub p_sigmask: ki_sigset_t, - pub p_sigignore: ki_sigset_t, - pub p_sigcatch: ki_sigset_t, - pub p_stat: i8, - pub p_priority: u8, - pub p_usrpri: u8, - pub p_nice: u8, - pub p_xstat: u16, - pub p_acflag: u16, - pub p_comm: [::c_char; KI_MAXCOMLEN as usize], - pub p_wmesg: [::c_char; KI_WMESGLEN as usize], - pub p_wchan: u64, - pub p_login: [::c_char; KI_MAXLOGNAME as usize], - pub p_vm_rssize: i32, - pub p_vm_tsize: i32, - pub p_vm_dsize: i32, - pub p_vm_ssize: i32, - pub p_uvalid: i64, - pub p_ustart_sec: u32, - pub p_ustart_usec: u32, - pub p_uutime_sec: u32, - pub p_uutime_usec: u32, - pub p_ustime_sec: u32, - pub p_ustime_usec: u32, - pub p_uru_maxrss: u64, - pub p_uru_ixrss: u64, - pub p_uru_idrss: u64, - pub p_uru_isrss: u64, - pub p_uru_minflt: u64, - pub p_uru_majflt: u64, - pub p_uru_nswap: u64, - pub p_uru_inblock: u64, - pub p_uru_oublock: u64, - pub p_uru_msgsnd: u64, - pub p_uru_msgrcv: u64, - pub p_uru_nsignals: u64, - pub p_uru_nvcsw: u64, - pub p_uru_nivcsw: u64, - pub p_uctime_sec: u32, - pub p_uctime_usec: u32, - pub p_cpuid: u64, - pub p_realflag: u64, - pub p_nlwps: u64, - pub p_nrlwps: u64, - pub p_realstat: u64, - pub p_svuid: u32, - pub p_svgid: u32, - pub p_ename: [::c_char; KI_MAXEMULLEN as usize], - pub p_vm_vsize: i64, - pub p_vm_msize: i64, - } - - pub struct kinfo_lwp { - pub l_forw: u64, - pub l_back: u64, - pub l_laddr: u64, - pub l_addr: u64, - pub l_lid: i32, - pub l_flag: i32, - pub l_swtime: u32, - pub l_slptime: u32, - pub l_schedflags: i32, - pub l_holdcnt: i32, - pub l_priority: u8, - pub l_usrpri: u8, - pub l_stat: i8, - l_pad1: i8, - l_pad2: i32, - pub l_wmesg: [::c_char; KI_WMESGLEN as usize], - pub l_wchan: u64, - pub l_cpuid: u64, - pub l_rtime_sec: u32, - pub l_rtime_usec: u32, - pub l_cpticks: u32, - pub l_pctcpu: u32, - pub l_pid: u32, - pub l_name: [::c_char; KI_LNAMELEN as usize], - } - pub struct kinfo_vmentry { pub kve_start: u64, pub kve_end: u64, @@ -1568,7 +1440,10 @@ pub const IPPROTO_VRRP: ::c_int = 112; /// Common Address Resolution Protocol pub const IPPROTO_CARP: ::c_int = 112; /// L2TPv3 -pub const IPPROTO_L2TP: ::c_int = 115; +// TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16, +// but isn't yet supported by the NetBSD rumprun kernel image used for +// libc testing. +//pub const IPPROTO_L2TP: ::c_int = 115; /// SCTP pub const IPPROTO_SCTP: ::c_int = 132; /// PFSYNC @@ -2228,18 +2103,9 @@ pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40; // Flags for chflags(2) -pub const SF_APPEND: ::c_ulong = 0x00040000; -pub const SF_ARCHIVED: ::c_ulong = 0x00010000; -pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; pub const SF_LOG: ::c_ulong = 0x00400000; -pub const SF_SETTABLE: ::c_ulong = 0xffff0000; pub const SF_SNAPINVAL: ::c_ulong = 0x00800000; -pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; -pub const UF_APPEND: ::c_ulong = 0x00000004; -pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; -pub const UF_NODUMP: ::c_ulong = 0x00000001; -pub const UF_OPAQUE: ::c_ulong = 0x00000008; -pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; // sys/sysctl.h pub const KVME_PROT_READ: ::c_int = 0x00000001; @@ -2255,22 +2121,6 @@ pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020; pub const NGROUPS_MAX: ::c_int = 16; -pub const KI_NGROUPS: ::c_int = 16; -pub const KI_MAXCOMLEN: ::c_int = 24; -pub const KI_WMESGLEN: ::c_int = 8; -pub const KI_MAXLOGNAME: ::c_int = 24; -pub const KI_MAXEMULLEN: ::c_int = 16; -pub const KI_LNAMELEN: ::c_int = 20; - -// sys/lwp.h -pub const LSIDL: ::c_int = 1; -pub const LSRUN: ::c_int = 2; -pub const LSSLEEP: ::c_int = 3; -pub const LSSTOP: ::c_int = 4; -pub const LSZOMB: ::c_int = 5; -pub const LSONPROC: ::c_int = 7; -pub const LSSUSPENDED: ::c_int = 8; - const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs index 1910f24a46bf6a1dadfe1b06e06160ab7fbaf3f8..199473dd6b02b8013bac8b6ab93007c8777debf0 100644 --- a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1628,17 +1628,6 @@ pub const EPROC_SLEADER: i32 = 0x02; // session leader pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked -// Flags for chflags(2) -pub const UF_SETTABLE: ::c_uint = 0x0000ffff; -pub const UF_NODUMP: ::c_uint = 0x00000001; -pub const UF_IMMUTABLE: ::c_uint = 0x00000002; -pub const UF_APPEND: ::c_uint = 0x00000004; -pub const UF_OPAQUE: ::c_uint = 0x00000008; -pub const SF_SETTABLE: ::c_uint = 0xffff0000; -pub const SF_ARCHIVED: ::c_uint = 0x00010000; -pub const SF_IMMUTABLE: ::c_uint = 0x00020000; -pub const SF_APPEND: ::c_uint = 0x00040000; - const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES diff --git a/bash-5.1/vendor/libc/src/unix/haiku/mod.rs b/bash-5.1/vendor/libc/src/unix/haiku/mod.rs index bb2e0351bf2cbf1c0a91f3c3217b34c6c6f56e62..ab1df724c0e1374eda7bf28ecd75055d14d6cf1a 100644 --- a/bash-5.1/vendor/libc/src/unix/haiku/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/haiku/mod.rs @@ -52,9 +52,6 @@ pub type Elf64_Xword = u64; pub type ENTRY = entry; pub type ACTION = ::c_int; -pub type posix_spawnattr_t = *mut ::c_void; -pub type posix_spawn_file_actions_t = *mut ::c_void; - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} impl ::Copy for timezone {} @@ -1054,7 +1051,6 @@ pub const LOCK_EX: ::c_int = 0x02; pub const LOCK_NB: ::c_int = 0x04; pub const LOCK_UN: ::c_int = 0x08; -pub const MINSIGSTKSZ: ::size_t = 8192; pub const SIGSTKSZ: ::size_t = 16384; pub const IOV_MAX: ::c_int = 1024; @@ -1071,9 +1067,6 @@ pub const SA_NOMASK: ::c_int = SA_NODEFER; pub const SA_STACK: ::c_int = SA_ONSTACK; pub const SA_ONESHOT: ::c_int = SA_RESETHAND; -pub const SS_ONSTACK: ::c_int = 0x1; -pub const SS_DISABLE: ::c_int = 0x2; - pub const FD_SETSIZE: usize = 1024; pub const RTLD_LOCAL: ::c_int = 0x0; @@ -1232,8 +1225,6 @@ pub const SO_PEERCRED: ::c_int = 0x4000000b; pub const SCM_RIGHTS: ::c_int = 0x01; -pub const SOMAXCONN: ::c_int = 32; - pub const NI_MAXHOST: ::size_t = 1025; pub const WNOHANG: ::c_int = 0x01; @@ -1243,12 +1234,6 @@ pub const WEXITED: ::c_int = 0x08; pub const WSTOPPED: ::c_int = 0x10; pub const WNOWAIT: ::c_int = 0x20; -// si_code values for SIGBUS signal -pub const BUS_ADRALN: ::c_int = 40; -pub const BUS_ADRERR: ::c_int = 41; -pub const BUS_OBJERR: ::c_int = 42; - -// si_code values for SIGCHLD signal pub const CLD_EXITED: ::c_int = 60; pub const CLD_KILLED: ::c_int = 61; pub const CLD_DUMPED: ::c_int = 62; @@ -1447,13 +1432,6 @@ pub const LOG_SERIAL: ::c_int = 16 << 12; pub const LOG_PERROR: ::c_int = 32 << 12; pub const LOG_NOWAIT: ::c_int = 64 << 12; -// spawn.h -pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; -pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; -pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; -pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; -pub const POSIX_SPAWN_SETSID: ::c_int = 0x40; - const_fn! { {const} fn CMSG_ALIGN(len: usize) -> usize { len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) @@ -1790,6 +1768,8 @@ extern "C" { pub fn endgrent(); pub fn getgrent() -> *mut ::group; pub fn setgrent(); + pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; + pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; pub fn pthread_atfork( prepare: ::Option, @@ -1904,74 +1884,6 @@ extern "C" { pub fn brk(addr: *mut ::c_void) -> ::c_int; pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; - - pub fn posix_spawn( - pid: *mut ::pid_t, - path: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - pub fn posix_spawnp( - pid: *mut ::pid_t, - file: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - - pub fn posix_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> ::c_int; - pub fn posix_spawn_file_actions_destroy( - file_actions: *mut posix_spawn_file_actions_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_addopen( - file_actions: *mut posix_spawn_file_actions_t, - fildes: ::c_int, - path: *const ::c_char, - oflag: ::c_int, - mode: ::mode_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_addclose( - file_actions: *mut posix_spawn_file_actions_t, - fildes: ::c_int, - ) -> ::c_int; - pub fn posix_spawn_file_actions_adddup2( - file_actions: *mut posix_spawn_file_actions_t, - fildes: ::c_int, - newfildes: ::c_int, - ) -> ::c_int; - - pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_getflags( - attr: *const posix_spawnattr_t, - _flags: *mut ::c_short, - ) -> ::c_int; - pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; - pub fn posix_spawnattr_getpgroup( - attr: *const posix_spawnattr_t, - _pgroup: *mut ::pid_t, - ) -> ::c_int; - pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: ::pid_t) -> ::c_int; - pub fn posix_spawnattr_getsigdefault( - attr: *const posix_spawnattr_t, - sigdefault: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigdefault( - attr: *mut posix_spawnattr_t, - sigdefault: *const ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_getsigmask( - attr: *const posix_spawnattr_t, - _sigmask: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigmask( - attr: *mut posix_spawnattr_t, - sigmask: *const ::sigset_t, - ) -> ::c_int; - } #[link(name = "bsd")] diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs index 67d0dacf17e93b1523d1ea5006eb9555bd77a05e..0995c5412ae5f7a9a71853bd853f39129532aa5f 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs @@ -346,9 +346,6 @@ cfg_if! { } else if #[cfg(target_arch = "aarch64")] { mod aarch64; pub use self::aarch64::*; - } else if #[cfg(target_arch = "riscv64")] { - mod riscv64; - pub use self::riscv64::*; } else { // Unknown target_arch } diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs index d25b50775537cd6048c0ebacecae850cf1cd1959..df116182066e6b8aa8d0ef081622fa8055bfa006 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -350,7 +350,6 @@ cfg_if! { fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { f.debug_struct("user_fpregs_struct") .field("cwd", &self.cwd) - .field("swd", &self.swd) .field("ftw", &self.ftw) .field("fop", &self.fop) .field("rip", &self.rip) @@ -367,7 +366,6 @@ cfg_if! { impl ::hash::Hash for user_fpregs_struct { fn hash(&self, state: &mut H) { self.cwd.hash(state); - self.swd.hash(state); self.ftw.hash(state); self.fop.hash(state); self.rip.hash(state); diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs index cfd229a474a92fc7ef22ecb049bb8e13c13a2b75..a57e9b7e763c6e76370d20d7db83014758f10ce3 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs @@ -2489,8 +2489,6 @@ pub const AF_VSOCK: ::c_int = 40; pub const PF_NFC: ::c_int = AF_NFC; pub const PF_VSOCK: ::c_int = AF_VSOCK; -pub const SOMAXCONN: ::c_int = 128; - // sys/system_properties.h pub const PROP_VALUE_MAX: ::c_int = 92; pub const PROP_NAME_MAX: ::c_int = 32; @@ -2498,216 +2496,6 @@ pub const PROP_NAME_MAX: ::c_int = 32; // sys/prctl.h pub const PR_SET_VMA: ::c_int = 0x53564d41; pub const PR_SET_VMA_ANON_NAME: ::c_int = 0; -pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; -pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; -pub const PR_GET_SECCOMP: ::c_int = 21; -pub const PR_SET_SECCOMP: ::c_int = 22; -pub const PR_GET_TIMING: ::c_int = 13; -pub const PR_SET_TIMING: ::c_int = 14; -pub const PR_TIMING_STATISTICAL: ::c_int = 0; -pub const PR_TIMING_TIMESTAMP: ::c_int = 1; - -// linux/if_addr.h -pub const IFA_UNSPEC: ::c_ushort = 0; -pub const IFA_ADDRESS: ::c_ushort = 1; -pub const IFA_LOCAL: ::c_ushort = 2; -pub const IFA_LABEL: ::c_ushort = 3; -pub const IFA_BROADCAST: ::c_ushort = 4; -pub const IFA_ANYCAST: ::c_ushort = 5; -pub const IFA_CACHEINFO: ::c_ushort = 6; -pub const IFA_MULTICAST: ::c_ushort = 7; - -pub const IFA_F_SECONDARY: u32 = 0x01; -pub const IFA_F_TEMPORARY: u32 = 0x01; -pub const IFA_F_NODAD: u32 = 0x02; -pub const IFA_F_OPTIMISTIC: u32 = 0x04; -pub const IFA_F_DADFAILED: u32 = 0x08; -pub const IFA_F_HOMEADDRESS: u32 = 0x10; -pub const IFA_F_DEPRECATED: u32 = 0x20; -pub const IFA_F_TENTATIVE: u32 = 0x40; -pub const IFA_F_PERMANENT: u32 = 0x80; - -// linux/if_link.h -pub const IFLA_UNSPEC: ::c_ushort = 0; -pub const IFLA_ADDRESS: ::c_ushort = 1; -pub const IFLA_BROADCAST: ::c_ushort = 2; -pub const IFLA_IFNAME: ::c_ushort = 3; -pub const IFLA_MTU: ::c_ushort = 4; -pub const IFLA_LINK: ::c_ushort = 5; -pub const IFLA_QDISC: ::c_ushort = 6; -pub const IFLA_STATS: ::c_ushort = 7; -pub const IFLA_COST: ::c_ushort = 8; -pub const IFLA_PRIORITY: ::c_ushort = 9; -pub const IFLA_MASTER: ::c_ushort = 10; -pub const IFLA_WIRELESS: ::c_ushort = 11; -pub const IFLA_PROTINFO: ::c_ushort = 12; -pub const IFLA_TXQLEN: ::c_ushort = 13; -pub const IFLA_MAP: ::c_ushort = 14; -pub const IFLA_WEIGHT: ::c_ushort = 15; -pub const IFLA_OPERSTATE: ::c_ushort = 16; -pub const IFLA_LINKMODE: ::c_ushort = 17; -pub const IFLA_LINKINFO: ::c_ushort = 18; -pub const IFLA_NET_NS_PID: ::c_ushort = 19; -pub const IFLA_IFALIAS: ::c_ushort = 20; -pub const IFLA_NUM_VF: ::c_ushort = 21; -pub const IFLA_VFINFO_LIST: ::c_ushort = 22; -pub const IFLA_STATS64: ::c_ushort = 23; -pub const IFLA_VF_PORTS: ::c_ushort = 24; -pub const IFLA_PORT_SELF: ::c_ushort = 25; -pub const IFLA_AF_SPEC: ::c_ushort = 26; -pub const IFLA_GROUP: ::c_ushort = 27; -pub const IFLA_NET_NS_FD: ::c_ushort = 28; -pub const IFLA_EXT_MASK: ::c_ushort = 29; -pub const IFLA_PROMISCUITY: ::c_ushort = 30; -pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31; -pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32; -pub const IFLA_CARRIER: ::c_ushort = 33; -pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34; -pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35; -pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36; -pub const IFLA_LINK_NETNSID: ::c_ushort = 37; -pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38; -pub const IFLA_PROTO_DOWN: ::c_ushort = 39; -pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40; -pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41; -pub const IFLA_PAD: ::c_ushort = 42; -pub const IFLA_XDP: ::c_ushort = 43; -pub const IFLA_EVENT: ::c_ushort = 44; -pub const IFLA_NEW_NETNSID: ::c_ushort = 45; -pub const IFLA_IF_NETNSID: ::c_ushort = 46; -pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID; -pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47; -pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48; -pub const IFLA_NEW_IFINDEX: ::c_ushort = 49; -pub const IFLA_MIN_MTU: ::c_ushort = 50; -pub const IFLA_MAX_MTU: ::c_ushort = 51; - -pub const IFLA_INFO_UNSPEC: ::c_ushort = 0; -pub const IFLA_INFO_KIND: ::c_ushort = 1; -pub const IFLA_INFO_DATA: ::c_ushort = 2; -pub const IFLA_INFO_XSTATS: ::c_ushort = 3; -pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4; -pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5; - -// linux/rtnetlink.h -pub const TCA_UNSPEC: ::c_ushort = 0; -pub const TCA_KIND: ::c_ushort = 1; -pub const TCA_OPTIONS: ::c_ushort = 2; -pub const TCA_STATS: ::c_ushort = 3; -pub const TCA_XSTATS: ::c_ushort = 4; -pub const TCA_RATE: ::c_ushort = 5; -pub const TCA_FCNT: ::c_ushort = 6; -pub const TCA_STATS2: ::c_ushort = 7; -pub const TCA_STAB: ::c_ushort = 8; - -pub const RTM_NEWLINK: u16 = 16; -pub const RTM_DELLINK: u16 = 17; -pub const RTM_GETLINK: u16 = 18; -pub const RTM_SETLINK: u16 = 19; -pub const RTM_NEWADDR: u16 = 20; -pub const RTM_DELADDR: u16 = 21; -pub const RTM_GETADDR: u16 = 22; -pub const RTM_NEWROUTE: u16 = 24; -pub const RTM_DELROUTE: u16 = 25; -pub const RTM_GETROUTE: u16 = 26; -pub const RTM_NEWNEIGH: u16 = 28; -pub const RTM_DELNEIGH: u16 = 29; -pub const RTM_GETNEIGH: u16 = 30; -pub const RTM_NEWRULE: u16 = 32; -pub const RTM_DELRULE: u16 = 33; -pub const RTM_GETRULE: u16 = 34; -pub const RTM_NEWQDISC: u16 = 36; -pub const RTM_DELQDISC: u16 = 37; -pub const RTM_GETQDISC: u16 = 38; -pub const RTM_NEWTCLASS: u16 = 40; -pub const RTM_DELTCLASS: u16 = 41; -pub const RTM_GETTCLASS: u16 = 42; -pub const RTM_NEWTFILTER: u16 = 44; -pub const RTM_DELTFILTER: u16 = 45; -pub const RTM_GETTFILTER: u16 = 46; -pub const RTM_NEWACTION: u16 = 48; -pub const RTM_DELACTION: u16 = 49; -pub const RTM_GETACTION: u16 = 50; -pub const RTM_NEWPREFIX: u16 = 52; -pub const RTM_GETMULTICAST: u16 = 58; -pub const RTM_GETANYCAST: u16 = 62; -pub const RTM_NEWNEIGHTBL: u16 = 64; -pub const RTM_GETNEIGHTBL: u16 = 66; -pub const RTM_SETNEIGHTBL: u16 = 67; -pub const RTM_NEWNDUSEROPT: u16 = 68; -pub const RTM_NEWADDRLABEL: u16 = 72; -pub const RTM_DELADDRLABEL: u16 = 73; -pub const RTM_GETADDRLABEL: u16 = 74; -pub const RTM_GETDCB: u16 = 78; -pub const RTM_SETDCB: u16 = 79; -pub const RTM_NEWNETCONF: u16 = 80; -pub const RTM_GETNETCONF: u16 = 82; -pub const RTM_NEWMDB: u16 = 84; -pub const RTM_DELMDB: u16 = 85; -pub const RTM_GETMDB: u16 = 86; -pub const RTM_NEWNSID: u16 = 88; -pub const RTM_DELNSID: u16 = 89; -pub const RTM_GETNSID: u16 = 90; - -pub const RTM_F_NOTIFY: ::c_uint = 0x100; -pub const RTM_F_CLONED: ::c_uint = 0x200; -pub const RTM_F_EQUALIZE: ::c_uint = 0x400; -pub const RTM_F_PREFIX: ::c_uint = 0x800; - -pub const RTA_UNSPEC: ::c_ushort = 0; -pub const RTA_DST: ::c_ushort = 1; -pub const RTA_SRC: ::c_ushort = 2; -pub const RTA_IIF: ::c_ushort = 3; -pub const RTA_OIF: ::c_ushort = 4; -pub const RTA_GATEWAY: ::c_ushort = 5; -pub const RTA_PRIORITY: ::c_ushort = 6; -pub const RTA_PREFSRC: ::c_ushort = 7; -pub const RTA_METRICS: ::c_ushort = 8; -pub const RTA_MULTIPATH: ::c_ushort = 9; -pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used -pub const RTA_FLOW: ::c_ushort = 11; -pub const RTA_CACHEINFO: ::c_ushort = 12; -pub const RTA_SESSION: ::c_ushort = 13; // No longer used -pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used -pub const RTA_TABLE: ::c_ushort = 15; -pub const RTA_MARK: ::c_ushort = 16; -pub const RTA_MFC_STATS: ::c_ushort = 17; - -pub const RTN_UNSPEC: ::c_uchar = 0; -pub const RTN_UNICAST: ::c_uchar = 1; -pub const RTN_LOCAL: ::c_uchar = 2; -pub const RTN_BROADCAST: ::c_uchar = 3; -pub const RTN_ANYCAST: ::c_uchar = 4; -pub const RTN_MULTICAST: ::c_uchar = 5; -pub const RTN_BLACKHOLE: ::c_uchar = 6; -pub const RTN_UNREACHABLE: ::c_uchar = 7; -pub const RTN_PROHIBIT: ::c_uchar = 8; -pub const RTN_THROW: ::c_uchar = 9; -pub const RTN_NAT: ::c_uchar = 10; -pub const RTN_XRESOLVE: ::c_uchar = 11; - -pub const RTPROT_UNSPEC: ::c_uchar = 0; -pub const RTPROT_REDIRECT: ::c_uchar = 1; -pub const RTPROT_KERNEL: ::c_uchar = 2; -pub const RTPROT_BOOT: ::c_uchar = 3; -pub const RTPROT_STATIC: ::c_uchar = 4; - -pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0; -pub const RT_SCOPE_SITE: ::c_uchar = 200; -pub const RT_SCOPE_LINK: ::c_uchar = 253; -pub const RT_SCOPE_HOST: ::c_uchar = 254; -pub const RT_SCOPE_NOWHERE: ::c_uchar = 255; - -pub const RT_TABLE_UNSPEC: ::c_uchar = 0; -pub const RT_TABLE_COMPAT: ::c_uchar = 252; -pub const RT_TABLE_DEFAULT: ::c_uchar = 253; -pub const RT_TABLE_MAIN: ::c_uchar = 254; -pub const RT_TABLE_LOCAL: ::c_uchar = 255; - -pub const RTMSG_NEWDEVICE: u32 = 0x11; -pub const RTMSG_DELDEVICE: u32 = 0x12; -pub const RTMSG_NEWROUTE: u32 = 0x21; -pub const RTMSG_DELROUTE: u32 = 0x22; f! { pub fn CMSG_NXTHDR(mhdr: *const msghdr, diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs index 31d0ebf25b104b175610b7974965fa4e224e6b8a..5494aad378cf26b1e110652b6cccce092647434a 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs @@ -1669,8 +1669,6 @@ pub const PRIO_PROCESS: ::c_int = 0; pub const PRIO_PGRP: ::c_int = 1; pub const PRIO_USER: ::c_int = 2; -pub const SOMAXCONN: ::c_int = 128; - f! { pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs index cb2df378cf5eab48d0a103bc17c84eaef7ed1500..154c2c54ce6deb78622883e3805113698588e374 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs @@ -26,26 +26,4 @@ s! { // auto-derive traits like Debug __reserved: [[u64; 32]; 16], } - - #[repr(align(16))] - pub struct user_fpsimd_struct { - pub vregs: [[u64; 2]; 32], - pub fpsr: ::c_uint, - pub fpcr: ::c_uint, - } - - #[repr(align(8))] - pub struct clone_args { - pub flags: ::c_ulonglong, - pub pidfd: ::c_ulonglong, - pub child_tid: ::c_ulonglong, - pub parent_tid: ::c_ulonglong, - pub exit_signal: ::c_ulonglong, - pub stack: ::c_ulonglong, - pub stack_size: ::c_ulonglong, - pub tls: ::c_ulonglong, - pub set_tid: ::c_ulonglong, - pub set_tid_size: ::c_ulonglong, - pub cgroup: ::c_ulonglong, - } } diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index 60a1b69323cf7bbdc31ceb546204d2676a0f849e..513f6acd1c8bbcf2422b315fb33712132f6633d7 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -573,22 +573,6 @@ pub const HWCAP_PACG: ::c_ulong = 1 << 31; //pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6; //pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7; //pub const HWCAP2_FRINT: ::c_ulong = 1 << 8; -//pub const HWCAP2_MTE: ::c_ulong = 1 << 18; - -// linux/prctl.h -pub const PR_PAC_RESET_KEYS: ::c_int = 54; -pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55; -pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56; -pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60; -pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61; - -pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1; - -pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0; -pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1; -pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2; -pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3; -pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4; // Syscall table pub const SYS_io_setup: ::c_long = 0; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs index ba3075edd7e36f9780a74a3c31d456418f213988..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs @@ -5,20 +5,3 @@ s_no_extra_traits! { priv_: [f64; 4] } } - -s! { - #[repr(align(8))] - pub struct clone_args { - pub flags: ::c_ulonglong, - pub pidfd: ::c_ulonglong, - pub child_tid: ::c_ulonglong, - pub parent_tid: ::c_ulonglong, - pub exit_signal: ::c_ulonglong, - pub stack: ::c_ulonglong, - pub stack_size: ::c_ulonglong, - pub tls: ::c_ulonglong, - pub set_tid: ::c_ulonglong, - pub set_tid_size: ::c_ulonglong, - pub cgroup: ::c_ulonglong, - } -} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 7e876f2d86c879270080908facbf97f9f81bb87f..61242268e08bc41bd0efbec38dd1bb722436488d 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -626,19 +626,6 @@ pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1; pub const PTRACE_SYSEMU: ::c_uint = 31; pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; -pub const PR_GET_SPECULATION_CTRL: ::c_int = 52; -pub const PR_SET_SPECULATION_CTRL: ::c_int = 53; -pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0; -pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0; -pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1; -pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2; -pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3; -pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4; -pub const PR_SPEC_STORE_BYPASS: ::c_int = 0; -pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1; -// FIXME: perharps for later -//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2; - pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs index 88bc935f632b3799cab5d0dd2d64d9ae61a69902..8a5f9d16988bcf87b47a39dbd878849f7af4c054 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs @@ -1025,8 +1025,6 @@ pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; -pub const SOMAXCONN: ::c_int = 4096; - //sys/timex.h pub const ADJ_OFFSET: ::c_uint = 0x0001; pub const ADJ_FREQUENCY: ::c_uint = 0x0002; @@ -1291,7 +1289,6 @@ extern "C" { attr: *mut ::pthread_rwlockattr_t, val: ::c_int, ) -> ::c_int; - pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int; pub fn mallinfo() -> ::mallinfo; pub fn mallinfo2() -> ::mallinfo2; pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int; @@ -1327,11 +1324,6 @@ extern "C" { pub fn malloc_trim(__pad: ::size_t) -> ::c_int; } -extern "C" { - pub fn gnu_get_libc_release() -> *const ::c_char; - pub fn gnu_get_libc_version() -> *const ::c_char; -} - cfg_if! { if #[cfg(any(target_arch = "x86", target_arch = "arm", diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs index aba691e5a85c613784f002c7b974cf4bd07a993d..2086f705a287f8ac63b82cc24ba62efcd2c9d1ee 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs @@ -1565,7 +1565,6 @@ pub const MSG_INFO: ::c_int = 12; pub const MSG_NOERROR: ::c_int = 0o10000; pub const MSG_EXCEPT: ::c_int = 0o20000; -pub const MSG_ZEROCOPY: ::c_int = 0x4000000; pub const SHM_R: ::c_int = 0o400; pub const SHM_W: ::c_int = 0o200; @@ -1811,7 +1810,6 @@ pub const ITIMER_PROF: ::c_int = 2; pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; pub const TFD_TIMER_ABSTIME: ::c_int = 1; -pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2; pub const _POSIX_VDISABLE: ::cc_t = 0; @@ -1843,17 +1841,6 @@ pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000; pub const IPV6_RTHDR_LOOSE: ::c_int = 0; pub const IPV6_RTHDR_STRICT: ::c_int = 1; -// SO_MEMINFO offsets -pub const SK_MEMINFO_RMEM_ALLOC: ::c_int = 0; -pub const SK_MEMINFO_RCVBUF: ::c_int = 1; -pub const SK_MEMINFO_WMEM_ALLOC: ::c_int = 2; -pub const SK_MEMINFO_SNDBUF: ::c_int = 3; -pub const SK_MEMINFO_FWD_ALLOC: ::c_int = 4; -pub const SK_MEMINFO_WMEM_QUEUED: ::c_int = 5; -pub const SK_MEMINFO_OPTMEM: ::c_int = 6; -pub const SK_MEMINFO_BACKLOG: ::c_int = 7; -pub const SK_MEMINFO_DROPS: ::c_int = 8; - pub const IUTF8: ::tcflag_t = 0x00004000; #[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] pub const CMSPAR: ::tcflag_t = 0o10000000000; @@ -3074,7 +3061,6 @@ pub const FUTEX_WAIT_BITSET: ::c_int = 9; pub const FUTEX_WAKE_BITSET: ::c_int = 10; pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11; pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12; -pub const FUTEX_LOCK_PI2: ::c_int = 13; pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs index a4bf9bff4f1474322735a183865a0d69b6e3ea84..81c55c64ad822e6ac50f4cb2273a2be88b464379 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs @@ -24,19 +24,4 @@ s! { pub pstate: ::c_ulong, __reserved: [[u64; 32]; 16], } - - #[repr(align(8))] - pub struct clone_args { - pub flags: ::c_ulonglong, - pub pidfd: ::c_ulonglong, - pub child_tid: ::c_ulonglong, - pub parent_tid: ::c_ulonglong, - pub exit_signal: ::c_ulonglong, - pub stack: ::c_ulonglong, - pub stack_size: ::c_ulonglong, - pub tls: ::c_ulonglong, - pub set_tid: ::c_ulonglong, - pub set_tid_size: ::c_ulonglong, - pub cgroup: ::c_ulonglong, - } } diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs index 1ed13f66bf2fe4a77917b12e7dfe931bdd78ac96..cb9bb930d844bbb85c9ec7a56e0daa20cc364269 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs @@ -458,7 +458,7 @@ pub const O_SYNC: ::c_int = 0x4010; pub const O_RSYNC: ::c_int = 0x4010; pub const O_DSYNC: ::c_int = 0x10; pub const O_ASYNC: ::c_int = 0x1000; -pub const O_LARGEFILE: ::c_int = 0x2000; +pub const O_LARGEFILE: ::c_int = 0; pub const EDEADLK: ::c_int = 45; pub const ENAMETOOLONG: ::c_int = 78; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs index cb6237abcfaf2bd385e7f6321d96279bfdbf16fc..5fdd03d2cde2bfbeea1036c650b0884ab98263b7 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -221,7 +221,6 @@ pub const ENOPROTOOPT: ::c_int = 92; pub const EPROTONOSUPPORT: ::c_int = 93; pub const ESOCKTNOSUPPORT: ::c_int = 94; pub const EOPNOTSUPP: ::c_int = 95; -pub const ENOTSUP: ::c_int = EOPNOTSUPP; pub const EPFNOSUPPORT: ::c_int = 96; pub const EAFNOSUPPORT: ::c_int = 97; pub const ENETDOWN: ::c_int = 100; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs index 94391a01a727ef2ac5f1320db867268d5fe84077..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs @@ -4,22 +4,4 @@ s_no_extra_traits! { pub struct max_align_t { priv_: [f64; 4] } - -} - -s! { - #[repr(align(8))] - pub struct clone_args { - pub flags: ::c_ulonglong, - pub pidfd: ::c_ulonglong, - pub child_tid: ::c_ulonglong, - pub parent_tid: ::c_ulonglong, - pub exit_signal: ::c_ulonglong, - pub stack: ::c_ulonglong, - pub stack_size: ::c_ulonglong, - pub tls: ::c_ulonglong, - pub set_tid: ::c_ulonglong, - pub set_tid_size: ::c_ulonglong, - pub cgroup: ::c_ulonglong, - } } diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs index 6cdc313881dbb6008e5c15855e6e1b746cc5e1e5..7071073458563b80c2caf86bc793100bfca67483 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs @@ -529,8 +529,6 @@ pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; pub const SOCK_DCCP: ::c_int = 6; pub const SOCK_PACKET: ::c_int = 10; -pub const SOMAXCONN: ::c_int = 128; - #[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] pub const SIGUNUSED: ::c_int = ::SIGSYS; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs index 4a01e0cd81c857f31e516a3683da20eca3c6193b..fc80f0f9d603bc0bb4dd77f9749290a3a69f7d1f 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs @@ -235,8 +235,6 @@ pub const PRIO_PROCESS: ::c_int = 0; pub const PRIO_PGRP: ::c_int = 1; pub const PRIO_USER: ::c_int = 2; -pub const SOMAXCONN: ::c_int = 128; - pub const ST_RELATIME: ::c_ulong = 4096; pub const AF_NFC: ::c_int = PF_NFC; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs index 57600f24b8f12dc57e0ce5444336133c43aae641..125c5d4e43a65d3fadf2cb92e13a30a9c33b95eb 100644 --- a/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs @@ -759,6 +759,8 @@ pub const PF_IEEE802154: ::c_int = AF_IEEE802154; pub const PF_CAIF: ::c_int = AF_CAIF; pub const PF_ALG: ::c_int = AF_ALG; +pub const SOMAXCONN: ::c_int = 128; + pub const MSG_OOB: ::c_int = 1; pub const MSG_PEEK: ::c_int = 2; pub const MSG_DONTROUTE: ::c_int = 4; @@ -1211,15 +1213,6 @@ pub const PIPE_BUF: usize = 4096; pub const SI_LOAD_SHIFT: ::c_uint = 16; -// si_code values for SIGBUS signal -pub const BUS_ADRALN: ::c_int = 1; -pub const BUS_ADRERR: ::c_int = 2; -pub const BUS_OBJERR: ::c_int = 3; -// Linux-specific si_code values for SIGBUS signal -pub const BUS_MCEERR_AR: ::c_int = 4; -pub const BUS_MCEERR_AO: ::c_int = 5; - -// si_code values for SIGCHLD signal pub const CLD_EXITED: ::c_int = 1; pub const CLD_KILLED: ::c_int = 2; pub const CLD_DUMPED: ::c_int = 3; @@ -1733,6 +1726,8 @@ extern "C" { pub fn clearenv() -> ::c_int; pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int; + pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; + pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; pub fn acct(filename: *const ::c_char) -> ::c_int; diff --git a/bash-5.1/vendor/libc/src/unix/mod.rs b/bash-5.1/vendor/libc/src/unix/mod.rs index ecc693e3db10531d1621cb872eab51f63a1b8ec0..ecee444111b703be159c3bde052ba8a096c6ef4d 100644 --- a/bash-5.1/vendor/libc/src/unix/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/mod.rs @@ -346,13 +346,13 @@ cfg_if! { } else if #[cfg(target_os = "emscripten")] { #[link(name = "c")] extern {} - } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] { - #[link(name = "c", kind = "static", modifiers = "-bundle", - cfg(target_feature = "crt-static"))] - #[link(name = "m", kind = "static", modifiers = "-bundle", - cfg(target_feature = "crt-static"))] - #[link(name = "m", cfg(not(target_feature = "crt-static")))] - #[link(name = "c", cfg(not(target_feature = "crt-static")))] + } else if #[cfg(all(target_os = "netbsd", + feature = "rustc-dep-of-std", + target_vendor = "rumprun"))] { + // Since we don't use -nodefaultlibs on Rumprun, libc is always pulled + // in automatically by the linker. We avoid passing it explicitly, as it + // causes some versions of binutils to crash with an assertion failure. + #[link(name = "m")] extern {} } else if #[cfg(any(target_os = "macos", target_os = "ios", @@ -901,8 +901,6 @@ extern "C" { pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int; pub fn setsid() -> pid_t; pub fn setuid(uid: uid_t) -> ::c_int; - pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int; - pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "sleep$UNIX2003" diff --git a/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs index 804cd66454f464ec8e767c0f653ff02ea2cd9ad5..38c99c6b35373212dd496ecb9ba173593df2bb02 100644 --- a/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs @@ -83,9 +83,6 @@ pub const MSG_DONTROUTE: ::c_int = 0x4; pub const MSG_WAITALL: ::c_int = 0x02; pub const MSG_MORE: ::c_int = 0x10; pub const MSG_NOSIGNAL: ::c_int = 0x20; -pub const MSG_TRUNC: ::c_int = 0x04; -pub const MSG_CTRUNC: ::c_int = 0x08; -pub const MSG_EOR: ::c_int = 0x08; pub const PTHREAD_STACK_MIN: ::size_t = 768; @@ -103,8 +100,6 @@ extern "C" { pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; #[link_name = "lwip_recvmsg"] pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; - - pub fn eventfd(initval: ::c_uint, flags: ::c_int) -> ::c_int; } pub use crate::unix::newlib::generic::{sigset_t, stat}; diff --git a/bash-5.1/vendor/libc/src/unix/solarish/mod.rs b/bash-5.1/vendor/libc/src/unix/solarish/mod.rs index fef08d08f4b6d2658a9eb39c40e253c3c8f3cefb..3ccdb8cab91a8d1dd0ba3ae2b5d5930e1e78d2fd 100644 --- a/bash-5.1/vendor/libc/src/unix/solarish/mod.rs +++ b/bash-5.1/vendor/libc/src/unix/solarish/mod.rs @@ -1796,8 +1796,6 @@ pub const TCP_LINGER2: ::c_int = 0x1c; pub const UDP_NAT_T_ENDPOINT: ::c_int = 0x0103; -pub const SOMAXCONN: ::c_int = 128; - pub const SOL_SOCKET: ::c_int = 0xffff; pub const SO_DEBUG: ::c_int = 0x01; pub const SO_ACCEPTCONN: ::c_int = 0x0002; diff --git a/bash-5.1/vendor/libc/src/windows/mod.rs b/bash-5.1/vendor/libc/src/windows/mod.rs index acb0de98951707abd05a9b69074f5ae9f53d5ab0..08cba4edd094b4538d616d343c34c2135a3118ec 100644 --- a/bash-5.1/vendor/libc/src/windows/mod.rs +++ b/bash-5.1/vendor/libc/src/windows/mod.rs @@ -277,16 +277,6 @@ impl ::Clone for fpos_t { } } -// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860 -#[cfg_attr( - all(windows, target_env = "msvc"), - link(name = "legacy_stdio_definitions") -)] -extern "C" { - pub fn printf(format: *const c_char, ...) -> ::c_int; - pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int; -} - extern "C" { pub fn isalnum(c: c_int) -> c_int; pub fn isalpha(c: c_int) -> c_int; @@ -329,6 +319,8 @@ extern "C" { pub fn feof(stream: *mut FILE) -> c_int; pub fn ferror(stream: *mut FILE) -> c_int; pub fn perror(s: *const c_char); + pub fn printf(format: *const c_char, ...) -> ::c_int; + pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int; pub fn atoi(s: *const c_char) -> c_int; pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; diff --git a/bash-5.1/vendor/nix/.cargo-checksum.json b/bash-5.1/vendor/nix/.cargo-checksum.json index 21c329711ad7026901dd39c21966e3cbbf61e074..e6ef259fc764e8edd6c5f94c1444f720897670d0 100644 --- a/bash-5.1/vendor/nix/.cargo-checksum.json +++ b/bash-5.1/vendor/nix/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"e20b4f5f1db072fdc61fd1ec040fea9f6fc6664b1d6a93cf5dc5cf00f027993f","Cargo.toml":"cede3efdf09707d6fb9fe3c1ad327ea2d0435c70b87cd9e2096be2927f122b1b","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"0bbe5a44884e8315d018df67c691cb57d059a30c3f3dd221beb3eee56cb5cf1f","src/dir.rs":"99f348b0c792d307e9c4c36793d8fb981e11e8ffc94a6801a65808a7d8e82065","src/env.rs":"028bc5e20139ebba418a655a2978a53335dc7680bf1de43d2c8333dd72cfa5c4","src/errno.rs":"3b6c568ed8c159603b21011e9b91879a20a0e46e7d94334ab323e14dfd0e2c2a","src/fcntl.rs":"1d40fecd555c94b92d97d99ec6d72a64c6c41b8d443c6db745a41d01f00cdc79","src/features.rs":"1e1e0247662466f6998d3a405c8742ce807fce3a27823575bd235e771c2392ac","src/ifaddrs.rs":"e59a7540976c7c60b89929febdf5f6384b42c6d801bd1f339236e0e9c5636b67","src/kmod.rs":"9031edb7b0a8ed1d6635163c9c32490537d5c204e9794cce9dc2db24ead60957","src/lib.rs":"1384fe677c3a53b48b3d4c41a91ade3611b2751cdd35a0712b3237d20be393fe","src/macros.rs":"e23d7d8be22ef0bf9febaaf2739585453103607c0139bd3995a324e4a16d011e","src/mount/bsd.rs":"114878b4f2ad712236965fc3ed227d37ea56f57156266709b526002c5b65aa6e","src/mount/linux.rs":"d938612abe89d2cf0d375b335a570ba4831f2009d3ef6c7e786ccbc398bf2c15","src/mount/mod.rs":"5c9d906d4760ac1a3767949e2cab69d7fa683c454c06045919c58a90689d439f","src/mqueue.rs":"8e227acb520020b06338bceb8e7e11705564e5f4d96ab51e0815dcadc01a8b4e","src/net/if_.rs":"74dcfa81b1b77303cd8047ca4e2ab60b8fcebaa4a01dc860dd0fec65ab334eb4","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"cae2182481438f27e14e4c1a88e1835ff371423c0cc8f685ffb0b479dd102e2e","src/pty.rs":"e94219e1981cb023d4f3c22edbe26c87f7508fa25b96b9f74b3b36436aebe2fb","src/sched.rs":"22ba33ee394ef23fbde7d1fca1f2f24fc487dd447b7c28d82c9165a0822b2894","src/sys/aio.rs":"9181e01eeef5ff6f89dec1eca58ba814a80df72736b955cd1b92278d5c79bea6","src/sys/epoll.rs":"6d9bcd668010ba26abb9c5ede9f3e238a56ce4949a5c51ee80853fc8e3c37607","src/sys/event.rs":"d69b7b86bed60d7bf609c636545a5d92f7f9ece7fd69db0e662f6d7e57f3237c","src/sys/eventfd.rs":"bc8009f19e8b93b03d0202896e10bd08497f34e2987bb8ce864d6cde11eab892","src/sys/inotify.rs":"215c4217f698b47f73f4418f98f331f06ca93d35e01c6f522e5fa6a156554174","src/sys/ioctl/bsd.rs":"bbd02e30b0a78c1cb22777d9b00cfcbba9c68505cffc06118ac68474cf6fea39","src/sys/ioctl/linux.rs":"028181834d119b834bf399f2b8a6176cc57e75144693f28f32059d087d8c8018","src/sys/ioctl/mod.rs":"89b20579476b2e0254e0ecb1b41830cccd7027a22cbdb816a9d4ec3924842ac1","src/sys/memfd.rs":"72a153df4da17ea0cc4ce90ee3c47c5bec24c6e32fbb4ee7c77c1a89d79efbdd","src/sys/mman.rs":"cf4970c2ec4eb668926267679bfb7b41e653190f719d7bd1ef768623e53117a3","src/sys/mod.rs":"1be43a6d0d40661851f222b305841555897168b7e75bd9bc9c7f1962bba93369","src/sys/personality.rs":"99677190a5a81e07fc2c5c2e4b9abacf0fd555776dd0eb266fa86b8f9e965dbf","src/sys/pthread.rs":"0407064036af5b1e6247eedd38157201104c51d73575ba2eaba5e89259521462","src/sys/ptrace/bsd.rs":"ca948c863fa55de1f9fc8eabd9fd7803054df08a6ee5044b2a6a7de49a321819","src/sys/ptrace/linux.rs":"ca780ecf61416252e45dd10b5ffa6120c65b22ec4362d4f2fbd554a9bcaf1084","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"d3127892f419939d63f75b9326d50e0866f7bdd92c9dcbd1cb3b6890a13b016c","src/sys/reboot.rs":"dbb1faeeb6525f1952a20cb75adbd76b0681b6214501f747cc154be2bbff7594","src/sys/resource.rs":"ee83c0a39e600c496e62592b65f8ca67c761ff9f00f30bb4bfd5cd5897281dad","src/sys/select.rs":"d30e8dfcfa46f6bd8d8b86676ad09d7aa6f1d7747d2c9601b9bb4f5ccf44b59f","src/sys/sendfile.rs":"637b09a267813c6adf72b6b74235175ed5347e3816777881ba8a9ab192c3e497","src/sys/signal.rs":"485c85a0d24a20ecf13c1d35ed740ee40498d9067cb3c0228f63323f89ba4de5","src/sys/signalfd.rs":"309eb1be7d72e8391acb5ba82b07cd6cf6fb26ddb3af914373f8889add6f52dd","src/sys/socket/addr.rs":"d7799cad83df1227d964e824598493871a463f0bf3aa27898f34155653d74453","src/sys/socket/mod.rs":"81bf377feca6fb018c8e293ce91febd95c344edb965a8f1dd7e2442b5cbad233","src/sys/socket/sockopt.rs":"f1f4704307eb76e2d29c256d722b6a8d09dc18e06378487da8fbfcc104546c3b","src/sys/stat.rs":"a7b30aa54033579aea16af4c904b3935c3816a72615537178ad6366b6c8cb381","src/sys/statfs.rs":"39a71fdd995a43210a850aac09ef3c858f0179cc0417c1abe16a1cc6a79fc10b","src/sys/statvfs.rs":"1e17f417675722690354e03184de9b9bfc1ba4367d2dc5446952ed71f67a0270","src/sys/sysinfo.rs":"ee087a4c1cd5f6efb9b29eb3d4e38438157120100fad4608ff863fc7d4d75538","src/sys/termios.rs":"81a3bf2f8995fdfbb560c2cc1bdf94b193b04a4673f085f24ecf0cd5be90b40a","src/sys/time.rs":"8319069283607875a9fe23c71c64ca76bf02681447ee6a45a9f53b8aed5f737b","src/sys/timer.rs":"5bf5068e3fe0050e7b79ed674569682c57f77bd24581ea7c7d58747989343c37","src/sys/timerfd.rs":"ee960c8475d26f01edbbeebcc8e5104a91d028d95aeec1de9d73f3f779130bb8","src/sys/uio.rs":"957e5a6650bd9a7887a332d134c6c1166588dec19530c4e9dbaca6969b99020d","src/sys/utsname.rs":"7f1c75dd550c9637a023a4629df571bcd292d53feee7b18f9f80dce425e65bea","src/sys/wait.rs":"5b21039400633d85aa49e153cc927cbf32d05df33c1d6a365921af2432b9495d","src/time.rs":"63ae33f73c79a70c811f87af2edd34e21ce93a3f89b3f176e35065fa1ece3ad7","src/ucontext.rs":"863d783443be1307477daf1970a42594d17d637aba94c8e5b63d5d9a49ea624b","src/unistd.rs":"38c774652a2adb22086eb4893d0921799addcae36b4632dabc1db79f3bbb224f","test/common/mod.rs":"1d7e28e3635754664cd056f3a1079232ff5c118df619e1d0551a9972eb0b3cd6","test/sys/mod.rs":"87b2891d83067ff21f72b8ff7fde3019dc45b6877282ac278b6da151de45c7a7","test/sys/test_aio.rs":"d2d9e9eb67a1075e43321413666a47195a03b84adf4faf235785e5d0b9158d50","test/sys/test_aio_drop.rs":"614070155fa16a979b7341d001639c5ce24a1d6f632c3abce45a5a6d49c4039b","test/sys/test_epoll.rs":"ffe95e36c79e37426ef8e8ca3b137b7f35ea0333ce666a20a4b7878db17680e9","test/sys/test_inotify.rs":"a141b9a995892547b51ceeb6761a70a6b86d37e8f38d13ea2c497b81b4b0f49f","test/sys/test_ioctl.rs":"ad25e422593408e4b14c7fb8a820e9cf6a73c2a81bd988d2ba70f780315f2403","test/sys/test_mman.rs":"f66da7990aea0b61f6e1c006fcd31389a42fa2f0ce6fdb7b02dfe314a533e32d","test/sys/test_pthread.rs":"ace36a2f5587f1874854281b4fd84e4e4d892a1e3c5cc38ced57975739522ad6","test/sys/test_ptrace.rs":"0385eebc8b1b8c72f655b745769decd9143ad83018198375982da0896310456b","test/sys/test_select.rs":"54cea1c34ad28d5770a613c1c3cbc3b1064b22037ec2b9d3fcd422d3be9e60a7","test/sys/test_signal.rs":"acc9941227bd3e2afad323613c2b8c83902ed0486d3745fd72704f395924f1e4","test/sys/test_signalfd.rs":"0e1060143e2612c490bc3d0168d0bbb042ef55e3f1d91d2578b9e42e4310a14d","test/sys/test_socket.rs":"9e86d4c15f256154f2626e663163ce823645f2934dc97edd6fc99a5f1df9164f","test/sys/test_sockopt.rs":"3013425f4e4936e8b8b1f8ea46446a840dd3c7741cd67c8706db0ae1510a3c33","test/sys/test_stat.rs":"31744a0621dace45ad20b42d16b2774cb153bceb713ca1d42038f2ad115bf6c1","test/sys/test_sysinfo.rs":"ffd49bc96375914a2c4a4a59730cae8072f85771e2c4a80d3403df38d967e272","test/sys/test_termios.rs":"e5bcef10c84bd7583d600d5601835bcb3cfc88781cb283ab0185bbef5faf4327","test/sys/test_timerfd.rs":"f99dda99b6b37ff9f216abe9f17120a3a62a7ac604c2e077279c39b985b7fe74","test/sys/test_uio.rs":"32656bd0a5699e4d019aa928edf104637937179782914a82d50d37226e84c421","test/sys/test_wait.rs":"6fd59fffeeb09ff620c359baefd062ba777598982b6cb001ccc07b6bc7605493","test/test.rs":"9f43d5001eefe1fe85ce20c4dab24474296a76d127dc25b39b4d8bd8798be45c","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"46aa32e5241cab5f5d74216aeb75427efdcdef054b061b19de36c1e9e0ea6b11","test/test_fcntl.rs":"3277cc195b97cb3950eef7016e380e2450ccc4b942019e5043089a421c31490d","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"c214eb631510ef6fd71046c77a8f99ff052cfb1ab7621d658ccd2154eeb1d51a","test/test_mount.rs":"7ffaa8a5b3c8fd66a0f9dfe82a13dbdd268f61aa6668d8e050d7cd986ef02350","test/test_mq.rs":"136071f24131aac0e65d5f29ac18e3806641dfae1164813f5570c0e3a6f70553","test/test_net.rs":"f2912327ebb2a3d37e6cff02a5ac3106cf889cc5c74404db4ef0034059ba26f1","test/test_nix_path.rs":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","test/test_nmount.rs":"d6c112547bb80968170b5497cda4b6cbf69dabec6f51d494bd52298995ceff18","test/test_poll.rs":"3e0b8f0397ba080785c61a3bfc3d637bc87f324bc4e52b5f1bf3ca0d32dbc9fe","test/test_pty.rs":"b26238a0783746cb31880e11eebc1913149be999ce75fbc2d6677bdd1e2731b2","test/test_ptymaster_drop.rs":"ae63c815f5028ddc67d194e86559483018ab1816316bdb917f40cee9364fd8a5","test/test_resource.rs":"40aef790ab745cec31a4b333d2ca406b462aa9bdf4a6d3756371e498b8d51e9a","test/test_sched.rs":"d2c8065cbec77d25230f03683dfde99828c0fa463969a5a8f50ebf913091d6bc","test/test_sendfile.rs":"bb41b4f3621b518e397d3a5b5ad3c5dcef3fe506afe516eab7572fbab92b77e3","test/test_stat.rs":"c407ca47a5258750076d041afad2f6add4c3563be36628bde1c5b314f5d0765d","test/test_time.rs":"f7a21b1e279e60e84909d5dadda97ded66d3326b131fe317badf9af0a1b50335","test/test_timer.rs":"3ae20d364f075d2811f3ff94eda9886682cc21d8807656007d2464fe36d1e361","test/test_unistd.rs":"8663cdb1de1d873e572f9fa08cae9f69c4cdceb0e7e3d6a5de1f24378c17513e"},"package":"e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"} \ No newline at end of file +{"files":{"CHANGELOG.md":"6ace7a11f8a0bd7883d0b5f0ad40d8c8c018a474677f14d9568d7c1f9d88a64f","Cargo.toml":"75e9539191f0b2664a4d89687cf59877259955fb6af85c5711a257690cf131bc","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"00ed4b7d1b538eaea937bcc82e51b21b4b185fac5e2d2124f3163f0c75b09795","src/dir.rs":"37f34eb1db53bc4953c4a0629f2b06a2130228898ae9afe42fe392af08d73842","src/env.rs":"3657fb51d8569ed525787e22cd2adb0ea5eb250d27641cfb8926be6908be4f38","src/errno.rs":"c973e7c0e769208ecdf20da5a7e026375c8eba785e825ff9d5ffe74290fa6a36","src/fcntl.rs":"a80857b4458c16d6ae15eaa71e5cd335ee2557ff598591f6296d898950fce963","src/features.rs":"18ac07e56c3187a650a0ea3b3eee9dacca51686fc3ca3fa0ddde449deb102f56","src/ifaddrs.rs":"e59a7540976c7c60b89929febdf5f6384b42c6d801bd1f339236e0e9c5636b67","src/kmod.rs":"9031edb7b0a8ed1d6635163c9c32490537d5c204e9794cce9dc2db24ead60957","src/lib.rs":"6330ce3b43d21d2ce658f2fab8b7c7e0c43080cf17002718b070d250ca9d70da","src/macros.rs":"257a3e46d315f4bc86f09c66f1dacf722424c96b39c7030a8b1dffc05dfd2bc6","src/mount/bsd.rs":"c14a0e477f08c2949945139fcae9f0ede1f15d17fdd4277f7344b6bd5fafdc48","src/mount/linux.rs":"d938612abe89d2cf0d375b335a570ba4831f2009d3ef6c7e786ccbc398bf2c15","src/mount/mod.rs":"5c9d906d4760ac1a3767949e2cab69d7fa683c454c06045919c58a90689d439f","src/mqueue.rs":"513120f89399fb832f78e8e6f151e23a0b5fcaea40745b465b3fe7080346dc87","src/net/if_.rs":"7e05ba4e41f9921dc5c78ba10c130bc79f31d26863f4db2df3754b6a317839c8","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"aab8f9e48db4fa43113e5e4eecb095dc1bfa76431d9792e5f79e305af28066ea","src/pty.rs":"e94219e1981cb023d4f3c22edbe26c87f7508fa25b96b9f74b3b36436aebe2fb","src/sched.rs":"83029c0f8f473f2e1323ecaae8e3f15dc0f5326afd7e768d024d91a80aa73e1c","src/sys/aio.rs":"505cd3edec0f8bc77a69c65e26c4f05b12ff565e58d0c029c466369e535eca27","src/sys/epoll.rs":"6d9bcd668010ba26abb9c5ede9f3e238a56ce4949a5c51ee80853fc8e3c37607","src/sys/event.rs":"19061ad0780d01bfd0a17c12d5527b8568aa3d0fa2b1e30692aa594c1dba4fca","src/sys/eventfd.rs":"bc8009f19e8b93b03d0202896e10bd08497f34e2987bb8ce864d6cde11eab892","src/sys/inotify.rs":"215c4217f698b47f73f4418f98f331f06ca93d35e01c6f522e5fa6a156554174","src/sys/ioctl/bsd.rs":"76acf6de6c9e2cd9367835f1b97815120e4baede4c2200661f396be4e4eb800e","src/sys/ioctl/linux.rs":"e91474bee3984a5b80ea41d5edafb4fdb9bf7c8e53969b6450cc56aa4dc7ad65","src/sys/ioctl/mod.rs":"6341f40c37227c77ca4bbb1864e60f99c43898eeaaf05ebb5132be1129550f4b","src/sys/memfd.rs":"72a153df4da17ea0cc4ce90ee3c47c5bec24c6e32fbb4ee7c77c1a89d79efbdd","src/sys/mman.rs":"93f3f4dc0212b0abb172a822e5cc179b15080bf4f5df6b91d950003650db889a","src/sys/mod.rs":"efcaefe12a84e86acd543168006963d062f52d929d1f40c1c79853297830c9d9","src/sys/personality.rs":"bf1daba7141811b39aa293e060a932bb1c2b3a5ac5552658e6509b8fa7b05016","src/sys/pthread.rs":"0407064036af5b1e6247eedd38157201104c51d73575ba2eaba5e89259521462","src/sys/ptrace/bsd.rs":"ca948c863fa55de1f9fc8eabd9fd7803054df08a6ee5044b2a6a7de49a321819","src/sys/ptrace/linux.rs":"7dadde65fa8aac137d9b189d4c571dd64eb44042d0117a0c28ff55dc73de5d66","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"1b60c34302e6fad9422fe0bec9fe7e6b93fbe554b8cfe98ecf5834daf93c84de","src/sys/reboot.rs":"dbb1faeeb6525f1952a20cb75adbd76b0681b6214501f747cc154be2bbff7594","src/sys/resource.rs":"a26d30490bcc56eb8b86faf23a3a4ada3c0cd3ce28e2b3040d5f36c668f14f20","src/sys/select.rs":"d30e8dfcfa46f6bd8d8b86676ad09d7aa6f1d7747d2c9601b9bb4f5ccf44b59f","src/sys/sendfile.rs":"637b09a267813c6adf72b6b74235175ed5347e3816777881ba8a9ab192c3e497","src/sys/signal.rs":"625e14dd43d5d7e1d3540543d6438e7a27edbd425838749592418caa18d01d08","src/sys/signalfd.rs":"2677af132b9f01ec277615a5d039f49fbdd06dc4442639df668561b74b9785c4","src/sys/socket/addr.rs":"668460421d0e0915e818ddfa20881f9734231d61311d2da37d4253e9f4476560","src/sys/socket/mod.rs":"2512428d5c1d7de28ff6a680dea880a7ee8e2b30f9f90d39ca91672138347066","src/sys/socket/sockopt.rs":"0935138ab2957814d1acc29a78b8fddc12c283fe2771aae918cf2f09673591a0","src/sys/stat.rs":"aaaf7802733ac6c13c8c1ad22b864d6ba5369c123c06700d5d7d37afe87e8a66","src/sys/statfs.rs":"5827183678ddffad548f131c4e906ef73d8453534b0ac5f838cbc79ee2a12a9c","src/sys/statvfs.rs":"b8e0ea6b22e5bcf906e7367393190a2c60251211c2b4c5fa616e314d50e90d4f","src/sys/sysinfo.rs":"7ff86d7848c2e8ded13b47dc53bf24cb0f4d7f3ded634d6d2f34558a2511ed99","src/sys/termios.rs":"9281d162b68802c8c3a7bdab0a71dc794c81de1493a259f602244d7dfba2d491","src/sys/time.rs":"5ccb77ee0ea0aea934ce92f57d3112dac3a64fcf5648ee01656500dee0136135","src/sys/timer.rs":"1263c84eca7487a0174d507f6c108fdb8ccddbeeafad66ae80e3ba509e7e6ab0","src/sys/timerfd.rs":"c9193f5e1b8d963c7d0d529602859242ec00210238ed30e359001b206c809071","src/sys/uio.rs":"6aa2d19685691a9808c30d89f472cefeed3467cc1335cff36494ba7acd6250d2","src/sys/utsname.rs":"7f1c75dd550c9637a023a4629df571bcd292d53feee7b18f9f80dce425e65bea","src/sys/wait.rs":"5b21039400633d85aa49e153cc927cbf32d05df33c1d6a365921af2432b9495d","src/time.rs":"63ae33f73c79a70c811f87af2edd34e21ce93a3f89b3f176e35065fa1ece3ad7","src/ucontext.rs":"863d783443be1307477daf1970a42594d17d637aba94c8e5b63d5d9a49ea624b","src/unistd.rs":"1560e6be2730531b1f9451475713d907bbfaaac8d33ec15071d2c5b92a8a545e","test/common/mod.rs":"2fb748319611c8ed528b5ea81d7dcfba3a47aabe915917ebbeb5451deaa86e2b","test/sys/mod.rs":"d569cc63defcdcd6d0e23c9799a3f69870a02bd910b50f5aa147f8b5a50e3a25","test/sys/test_aio.rs":"414af194f06b35b83a692e3569801f2c6b7999ba7b55b59f006091902e00146e","test/sys/test_aio_drop.rs":"dbb6808f7813be0de12cef11c4156637eab1d990df6f1192cbc4b26b072b633a","test/sys/test_epoll.rs":"c982bd8fa90c615a6f11de2c816b4553e11171dbbdd8db0944166fb044221a16","test/sys/test_inotify.rs":"dc3e4fe548b0b3b71f94c9bfc157c21b017f5ce8df9dee599849f3bfe7c222bb","test/sys/test_ioctl.rs":"b809085aca01c351380b3ab650153d3800f7271391e090b6f2d6dc9186ee50f4","test/sys/test_lio_listio_resubmit.rs":"436135fce2d2e55cfc9a3a18d43ca15018feb1a51b870eed56dff2f734b9c059","test/sys/test_mman.rs":"09ec20c05f63a909f5ce3b8b3223cbc7240ca9f93a4a3ed50d20a416ab6e7296","test/sys/test_pthread.rs":"4be4a467ead0633429157c1b2191eb28962c5670aeb2ad6fe872acb95c336129","test/sys/test_ptrace.rs":"4a9df38ff14e39967763805e86d7cac86a7411f485815a6aa50b8f0321a84a48","test/sys/test_select.rs":"913ee0569c539fbf8f8d87678cec7ceb9d5529c184e72af845c8076b099b7d29","test/sys/test_signal.rs":"619aeb586309ffd2547b22c37475bb8cf6e88717c4cc114df72f6786b14de1f3","test/sys/test_signalfd.rs":"cccba36d0aba74178d78571dbd728448c8c23aba9063ad5ee24c7d89d01429c6","test/sys/test_socket.rs":"c3e67c6e053ec095170804f7d7e1a0856ccc78add564e0445ba3d49563ce88aa","test/sys/test_sockopt.rs":"c635f46e9c4f479e78e97ce712263bc9dd6a708ca4a3630b0f1fb9cdc0358570","test/sys/test_sysinfo.rs":"1e1bea9130fe38ccb07cd0ad7334c7be1e45efc33f7656a5973f8cad7126f225","test/sys/test_termios.rs":"9a9fb30655f418b59851edc9a9763f0fa1a97faaa5310989d9fa9a5c21add111","test/sys/test_timerfd.rs":"fcada956abd981e4d846da58e5640c5705b16026d47bccd1d603fae765ad10db","test/sys/test_uio.rs":"1e92ae46a1d7d9d0025fbe631123909e97c29264898d59294f0a9cda09d8a298","test/sys/test_wait.rs":"011397c19b2960ec0aa4866405d68a0307b871f52a3d6d627341b836fb4a025c","test/test.rs":"68966e13a75411107ba525891f854613650dc8621dba73fd7158b84c55bb6f55","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"837d1666d6c48da3ae9f172fa32a497e0d61af94f1e5335c2afd16eafd6b1989","test/test_fcntl.rs":"a61a12011062402900cc709f31c414ba19763107d711f69a17d1e1e71ee3be82","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"58ac2bfb788480833d0bab990177324a405bd56d980edc222807acfb12ef23cf","test/test_mount.rs":"6b01b884b97db926ec1d4792f171344c590224554f2930c75609aaf2c0773abf","test/test_mq.rs":"b1609d4d25d6a4aaf0425d7a08700736ec3aa56b971b833fd41c4235b47922a9","test/test_net.rs":"d027680cdb1e2eed9e6912267b42a30cc0d81399826e03abfd7de81296a88282","test/test_nix_path.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","test/test_nmount.rs":"26ecb0c687d9403e2d34d8e67733ddeeba7b4820f886ffa14e75f05ec4de38ea","test/test_poll.rs":"7c7ca94669c7879ee73d793a0261b27904b80c0bb380a5b5acdd4960c9c1aba5","test/test_pty.rs":"4a6dd1afe0056678f1f2c1f27f309827da5806889c4b87dafa8889664889762d","test/test_ptymaster_drop.rs":"48ae888ff4573c68e4da7d1fa737374deb307afb64deff2d788d1e0c81a11112","test/test_resource.rs":"fcbb16942458fa2c11fa4a75831f038b532d87809920dbe30c1af67d4800d94a","test/test_sched.rs":"f8ad92eb554164b0f92428f716db99040186d741cc6e1976f7930f099652f70c","test/test_sendfile.rs":"20739ab4430a23be04a980578c831a0813a94c15e595965aa74bc9882fa79bf8","test/test_stat.rs":"8632715b3f38e5b150108d219959ee8de4d69c2b1ab5321c7ca218bb7a583d0d","test/test_time.rs":"bf668b680db81e443fb402a2580425553329636cd39fad70b828041ea894b43a","test/test_timer.rs":"1c2bab1787c343a2db2963c77f484a038a63e68ed9e98629c8af05a343908372","test/test_unistd.rs":"52966b7c7cff426a9dfb2143699fc4f7e293f8cebfd14b18502df6184f5af58e"},"package":"8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"} \ No newline at end of file diff --git a/bash-5.1/vendor/nix/CHANGELOG.md b/bash-5.1/vendor/nix/CHANGELOG.md index f06e412d938925d1dcda2443ba20fea95189ed25..b6639a1a7a8adaa8eb7e6702b5ea03d44ef19c38 100644 --- a/bash-5.1/vendor/nix/CHANGELOG.md +++ b/bash-5.1/vendor/nix/CHANGELOG.md @@ -3,85 +3,16 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -## [0.25.0] - 2022-08-13 +## [0.24.1] - 2022-04-22 ### Added - -- Added `faccessat` - ([#1780](https://github.com/nix-rust/nix/pull/1780)) -- Added `memfd` on Android. - (#[1773](https://github.com/nix-rust/nix/pull/1773)) -- Added `ETH_P_ALL` to `SockProtocol` enum - (#[1768](https://github.com/nix-rust/nix/pull/1768)) -- Added four non-standard Linux `SysconfVar` variants - (#[1761](https://github.com/nix-rust/nix/pull/1761)) -- Added const constructors for `TimeSpec` and `TimeVal` - (#[1760](https://github.com/nix-rust/nix/pull/1760)) -- Added `chflags`. - (#[1758](https://github.com/nix-rust/nix/pull/1758)) -- Added `aio_writev` and `aio_readv`. - (#[1713](https://github.com/nix-rust/nix/pull/1713)) -- impl `From` for `Uid` and `From` for `Gid` - (#[1727](https://github.com/nix-rust/nix/pull/1727)) -- impl `From` for `std::net::SocketAddrV4` and - impl `From` for `std::net::SocketAddrV6`. - (#[1711](https://github.com/nix-rust/nix/pull/1711)) -- Added support for the `x86_64-unknown-haiku` target. - (#[1703](https://github.com/nix-rust/nix/pull/1703)) -- Added `ptrace::read_user` and `ptrace::write_user` for Linux. - (#[1697](https://github.com/nix-rust/nix/pull/1697)) -- Added `getrusage` and helper types `UsageWho` and `Usage` - (#[1747](https://github.com/nix-rust/nix/pull/1747)) -- Added the `DontRoute` SockOpt - (#[1752](https://github.com/nix-rust/nix/pull/1752)) -- Added `signal::SigSet::from_sigset_t_unchecked()`. - (#[1741](https://github.com/nix-rust/nix/pull/1741)) -- Added the `Ipv4OrigDstAddr` sockopt and control message. - (#[1772](https://github.com/nix-rust/nix/pull/1772)) -- Added the `Ipv6OrigDstAddr` sockopt and control message. - (#[1772](https://github.com/nix-rust/nix/pull/1772)) -- Added the `Ipv4SendSrcAddr` control message. - (#[1776](https://github.com/nix-rust/nix/pull/1776)) - ### Changed - -- Rewrote the aio module. The new module: - * Does more type checking at compile time rather than runtime. - * Gives the caller control over whether and when to `Box` an aio operation. - * Changes the type of the `priority` arguments to `i32`. - * Changes the return type of `aio_return` to `usize`. - (#[1713](https://github.com/nix-rust/nix/pull/1713)) -- `nix::poll::ppoll`: `sigmask` parameter is now optional. - (#[1739](https://github.com/nix-rust/nix/pull/1739)) -- Changed `gethostname` to return an owned `OsString`. - (#[1745](https://github.com/nix-rust/nix/pull/1745)) -- `signal:SigSet` is now marked as `repr(transparent)`. - (#[1741](https://github.com/nix-rust/nix/pull/1741)) - -### Removed - -- Removed support for resubmitting partially complete `lio_listio` operations. - It was too complicated, and didn't fit Nix's theme of zero-cost abstractions. - Instead, it can be reimplemented downstream. - (#[1713](https://github.com/nix-rust/nix/pull/1713)) - -## [0.24.2] - 2022-07-17 -### Fixed - -- Fixed buffer overflow in `nix::sys::socket::recvfrom`. - (#[1763](https://github.com/nix-rust/nix/pull/1763)) -- Enabled `SockaddrStorage::{as_link_addr, as_link_addr_mut}` for Linux-like - operating systems. - (#[1729](https://github.com/nix-rust/nix/pull/1729)) -- Fixed `SockaddrLike::from_raw` implementations for `VsockAddr` and - `SysControlAddr`. - (#[1736](https://github.com/nix-rust/nix/pull/1736)) - -## [0.24.1] - 2022-04-22 ### Fixed - Fixed `UnixAddr::size` on Linux-based OSes. (#[1702](https://github.com/nix-rust/nix/pull/1702)) +### Removed + ## [0.24.0] - 2022-04-21 ### Added @@ -191,6 +122,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## [0.23.1] - 2021-12-16 +### Added ### Changed - Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts diff --git a/bash-5.1/vendor/nix/Cargo.toml b/bash-5.1/vendor/nix/Cargo.toml index 21b316c656f3edf4772d56bc182f49e26c6c9e87..fb4afc81105065a84285011cc83bf78629dae135 100644 --- a/bash-5.1/vendor/nix/Cargo.toml +++ b/bash-5.1/vendor/nix/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.46" name = "nix" -version = "0.25.0" +version = "0.24.1" authors = ["The nix-rust Project Developers"] include = [ "src/**/*", @@ -59,6 +59,10 @@ path = "test/sys/test_aio_drop.rs" name = "test-clearenv" path = "test/test_clearenv.rs" +[[test]] +name = "test-lio-listio-resubmit" +path = "test/sys/test_lio_listio_resubmit.rs" + [[test]] name = "test-mount" path = "test/test_mount.rs" @@ -75,18 +79,14 @@ version = "1.1" version = "1.0" [dependencies.libc] -version = "0.2.127" +version = "0.2.121" features = ["extra_traits"] -[dependencies.pin-utils] -version = "0.1.0" -optional = true - [dev-dependencies.assert-impl] version = "0.1" [dev-dependencies.lazy_static] -version = "1.4" +version = "1.2" [dev-dependencies.parking_lot] version = "0.11.2" @@ -95,17 +95,14 @@ version = "0.11.2" version = "0.8" [dev-dependencies.semver] -version = "1.0.7" +version = "1.0.0" [dev-dependencies.tempfile] -version = "3.3.0" - -[build-dependencies.autocfg] -version = "1.1.0" +version = "3.2.0" [features] acct = [] -aio = ["pin-utils"] +aio = [] default = [ "acct", "aio", @@ -175,11 +172,11 @@ zerocopy = [ ] [target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] -version = "0.5.3" +version = "0.5.1" [target."cfg(not(target_os = \"redox\"))".dependencies.memoffset] version = "0.6.3" optional = true [target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] -version = "0.4" +version = "0.1" diff --git a/bash-5.1/vendor/nix/README.md b/bash-5.1/vendor/nix/README.md index 7c13cf201c369aafa3eb6ed75fe4dd10e0915986..b0c27b16f34c30f847448a5c7fa7ac49b3ee3495 100644 --- a/bash-5.1/vendor/nix/README.md +++ b/bash-5.1/vendor/nix/README.md @@ -24,8 +24,8 @@ call: // libc api (unsafe, requires handling return code/errno) pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; -// nix api (returns a nix::Result) -pub fn gethostname() -> Result; +// nix api (returns a nix::Result) +pub fn gethostname<'a>(buffer: &'a mut [u8]) -> Result<&'a CStr>; ``` ## Supported Platforms @@ -82,7 +82,6 @@ Tier 3: * armv7-unknown-linux-uclibceabihf * x86_64-fuchsia * x86_64-unknown-dragonfly - * x86_64-unknown-haiku * x86_64-unknown-linux-gnux32 * x86_64-unknown-openbsd * x86_64-unknown-redox diff --git a/bash-5.1/vendor/nix/src/dir.rs b/bash-5.1/vendor/nix/src/dir.rs index 6d5fc3b9252c4b379d1031c2eff49567e3487e9b..396b54fb031dee7a80f8faf230947e63a4879de6 100644 --- a/bash-5.1/vendor/nix/src/dir.rs +++ b/bash-5.1/vendor/nix/src/dir.rs @@ -1,5 +1,3 @@ -//! List directory contents - use crate::{Error, NixPath, Result}; use crate::errno::Errno; use crate::fcntl::{self, OFlag}; @@ -55,7 +53,6 @@ impl Dir { } /// Converts from a file descriptor, closing it on success or failure. - #[cfg_attr(has_doc_alias, doc(alias("fdopendir")))] pub fn from_fd(fd: RawFd) -> Result { let d = ptr::NonNull::new(unsafe { libc::fdopendir(fd) }).ok_or_else(|| { let e = Error::last(); @@ -116,7 +113,6 @@ fn next(dir: &mut Dir) -> Option> { } } -/// Return type of [`Dir::iter`]. #[derive(Debug, Eq, Hash, PartialEq)] pub struct Iter<'d>(&'d mut Dir); @@ -186,22 +182,14 @@ impl IntoIterator for Dir { #[repr(transparent)] pub struct Entry(dirent); -/// Type of file referenced by a directory entry #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] pub enum Type { - /// FIFO (Named pipe) Fifo, - /// Character device CharacterDevice, - /// Directory Directory, - /// Block device BlockDevice, - /// Regular file File, - /// Symbolic link Symlink, - /// Unix-domain socket Socket, } @@ -238,7 +226,7 @@ impl Entry { /// notably, some Linux filesystems don't implement this. The caller should use `stat` or /// `fstat` if this returns `None`. pub fn file_type(&self) -> Option { - #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] match self.0.d_type { libc::DT_FIFO => Some(Type::Fifo), libc::DT_CHR => Some(Type::CharacterDevice), @@ -250,8 +238,8 @@ impl Entry { /* libc::DT_UNKNOWN | */ _ => None, } - // illumos, Solaris, and Haiku systems do not have the d_type member at all: - #[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))] + // illumos and Solaris systems do not have the d_type member at all: + #[cfg(any(target_os = "illumos", target_os = "solaris"))] None } } diff --git a/bash-5.1/vendor/nix/src/env.rs b/bash-5.1/vendor/nix/src/env.rs index 95177a1d2a1aae9dd5126acda468679af8cd84d9..bcae28713edb90edb54c24b0d1bcaa9e6d254f6d 100644 --- a/bash-5.1/vendor/nix/src/env.rs +++ b/bash-5.1/vendor/nix/src/env.rs @@ -42,6 +42,7 @@ pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> { cfg_if! { if #[cfg(any(target_os = "fuchsia", target_os = "wasi", + target_env = "wasi", target_env = "uclibc", target_os = "linux", target_os = "android", diff --git a/bash-5.1/vendor/nix/src/errno.rs b/bash-5.1/vendor/nix/src/errno.rs index 912fb94f55f22a9edb30b83dc6d200402bb02eb6..17744fe22a1a409d39acff71188a7ec9392ec132 100644 --- a/bash-5.1/vendor/nix/src/errno.rs +++ b/bash-5.1/vendor/nix/src/errno.rs @@ -1,8 +1,8 @@ -use crate::{Error, Result}; use cfg_if::cfg_if; use libc::{c_int, c_void}; use std::convert::TryFrom; -use std::{error, fmt, io}; +use std::{fmt, io, error}; +use crate::{Error, Result}; pub use self::consts::*; @@ -30,10 +30,6 @@ cfg_if! { unsafe fn errno_location() -> *mut c_int { libc::___errno() } - } else if #[cfg(any(target_os = "haiku",))] { - unsafe fn errno_location() -> *mut c_int { - libc::_errnop() - } } } @@ -47,7 +43,9 @@ fn clear() { /// Returns the platform-specific value of errno pub fn errno() -> i32 { - unsafe { (*errno_location()) as i32 } + unsafe { + (*errno_location()) as i32 + } } impl Errno { @@ -61,20 +59,29 @@ impl Errno { /// let e = Error::from(Errno::EPERM); /// assert_eq!(Some(Errno::EPERM), e.as_errno()); /// ``` - #[deprecated(since = "0.22.0", note = "It's a no-op now; just delete it.")] + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] pub const fn as_errno(self) -> Option { Some(self) } /// Create a nix Error from a given errno - #[deprecated(since = "0.22.0", note = "It's a no-op now; just delete it.")] + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] #[allow(clippy::wrong_self_convention)] // False positive pub fn from_errno(errno: Errno) -> Error { errno } /// Create a new invalid argument error (`EINVAL`) - #[deprecated(since = "0.22.0", note = "Use Errno::EINVAL instead")] + #[deprecated( + since = "0.22.0", + note = "Use Errno::EINVAL instead" + )] pub const fn invalid_argument() -> Error { Errno::EINVAL } @@ -111,7 +118,10 @@ impl Errno { /// In older versions of Nix, `Error::Sys` was an enum variant. Now it's a /// function, which is compatible with most of the former use cases of the /// enum variant. But you should use `Error(Errno::...)` instead. - #[deprecated(since = "0.22.0", note = "Use Errno::... instead")] + #[deprecated( + since = "0.22.0", + note = "Use Errno::... instead" + )] #[allow(non_snake_case)] #[inline] pub const fn Sys(errno: Errno) -> Error { @@ -126,33 +136,23 @@ pub trait ErrnoSentinel: Sized { } impl ErrnoSentinel for isize { - fn sentinel() -> Self { - -1 - } + fn sentinel() -> Self { -1 } } impl ErrnoSentinel for i32 { - fn sentinel() -> Self { - -1 - } + fn sentinel() -> Self { -1 } } impl ErrnoSentinel for i64 { - fn sentinel() -> Self { - -1 - } + fn sentinel() -> Self { -1 } } impl ErrnoSentinel for *mut c_void { - fn sentinel() -> Self { - -1isize as *mut c_void - } + fn sentinel() -> Self { -1isize as *mut c_void } } impl ErrnoSentinel for libc::sighandler_t { - fn sentinel() -> Self { - libc::SIG_ERR - } + fn sentinel() -> Self { libc::SIG_ERR } } impl error::Error for Errno {} @@ -173,7 +173,9 @@ impl TryFrom for Errno { type Error = io::Error; fn try_from(ioerror: io::Error) -> std::result::Result { - ioerror.raw_os_error().map(Errno::from_i32).ok_or(ioerror) + ioerror.raw_os_error() + .map(Errno::from_i32) + .ok_or(ioerror) } } @@ -184,1117 +186,728 @@ fn last() -> Errno { fn desc(errno: Errno) -> &'static str { use self::Errno::*; match errno { - UnknownErrno => "Unknown errno", - EPERM => "Operation not permitted", - ENOENT => "No such file or directory", - ESRCH => "No such process", - EINTR => "Interrupted system call", - EIO => "I/O error", - ENXIO => "No such device or address", - E2BIG => "Argument list too long", - ENOEXEC => "Exec format error", - EBADF => "Bad file number", - ECHILD => "No child processes", - EAGAIN => "Try again", - ENOMEM => "Out of memory", - EACCES => "Permission denied", - EFAULT => "Bad address", - #[cfg(not(target_os = "haiku"))] - ENOTBLK => "Block device required", - EBUSY => "Device or resource busy", - EEXIST => "File exists", - EXDEV => "Cross-device link", - ENODEV => "No such device", - ENOTDIR => "Not a directory", - EISDIR => "Is a directory", - EINVAL => "Invalid argument", - ENFILE => "File table overflow", - EMFILE => "Too many open files", - ENOTTY => "Not a typewriter", - ETXTBSY => "Text file busy", - EFBIG => "File too large", - ENOSPC => "No space left on device", - ESPIPE => "Illegal seek", - EROFS => "Read-only file system", - EMLINK => "Too many links", - EPIPE => "Broken pipe", - EDOM => "Math argument out of domain of func", - ERANGE => "Math result not representable", - EDEADLK => "Resource deadlock would occur", - ENAMETOOLONG => "File name too long", - ENOLCK => "No record locks available", - ENOSYS => "Function not implemented", - ENOTEMPTY => "Directory not empty", - ELOOP => "Too many symbolic links encountered", - ENOMSG => "No message of desired type", - EIDRM => "Identifier removed", - EINPROGRESS => "Operation now in progress", - EALREADY => "Operation already in progress", - ENOTSOCK => "Socket operation on non-socket", - EDESTADDRREQ => "Destination address required", - EMSGSIZE => "Message too long", - EPROTOTYPE => "Protocol wrong type for socket", - ENOPROTOOPT => "Protocol not available", + UnknownErrno => "Unknown errno", + EPERM => "Operation not permitted", + ENOENT => "No such file or directory", + ESRCH => "No such process", + EINTR => "Interrupted system call", + EIO => "I/O error", + ENXIO => "No such device or address", + E2BIG => "Argument list too long", + ENOEXEC => "Exec format error", + EBADF => "Bad file number", + ECHILD => "No child processes", + EAGAIN => "Try again", + ENOMEM => "Out of memory", + EACCES => "Permission denied", + EFAULT => "Bad address", + ENOTBLK => "Block device required", + EBUSY => "Device or resource busy", + EEXIST => "File exists", + EXDEV => "Cross-device link", + ENODEV => "No such device", + ENOTDIR => "Not a directory", + EISDIR => "Is a directory", + EINVAL => "Invalid argument", + ENFILE => "File table overflow", + EMFILE => "Too many open files", + ENOTTY => "Not a typewriter", + ETXTBSY => "Text file busy", + EFBIG => "File too large", + ENOSPC => "No space left on device", + ESPIPE => "Illegal seek", + EROFS => "Read-only file system", + EMLINK => "Too many links", + EPIPE => "Broken pipe", + EDOM => "Math argument out of domain of func", + ERANGE => "Math result not representable", + EDEADLK => "Resource deadlock would occur", + ENAMETOOLONG => "File name too long", + ENOLCK => "No record locks available", + ENOSYS => "Function not implemented", + ENOTEMPTY => "Directory not empty", + ELOOP => "Too many symbolic links encountered", + ENOMSG => "No message of desired type", + EIDRM => "Identifier removed", + EINPROGRESS => "Operation now in progress", + EALREADY => "Operation already in progress", + ENOTSOCK => "Socket operation on non-socket", + EDESTADDRREQ => "Destination address required", + EMSGSIZE => "Message too long", + EPROTOTYPE => "Protocol wrong type for socket", + ENOPROTOOPT => "Protocol not available", EPROTONOSUPPORT => "Protocol not supported", - #[cfg(not(target_os = "haiku"))] ESOCKTNOSUPPORT => "Socket type not supported", - #[cfg(not(target_os = "haiku"))] - EPFNOSUPPORT => "Protocol family not supported", - #[cfg(not(target_os = "haiku"))] - EAFNOSUPPORT => "Address family not supported by protocol", - EADDRINUSE => "Address already in use", - EADDRNOTAVAIL => "Cannot assign requested address", - ENETDOWN => "Network is down", - ENETUNREACH => "Network is unreachable", - ENETRESET => "Network dropped connection because of reset", - ECONNABORTED => "Software caused connection abort", - ECONNRESET => "Connection reset by peer", - ENOBUFS => "No buffer space available", - EISCONN => "Transport endpoint is already connected", - ENOTCONN => "Transport endpoint is not connected", - ESHUTDOWN => "Cannot send after transport endpoint shutdown", - #[cfg(not(target_os = "haiku"))] - ETOOMANYREFS => "Too many references: cannot splice", - ETIMEDOUT => "Connection timed out", - ECONNREFUSED => "Connection refused", - EHOSTDOWN => "Host is down", - EHOSTUNREACH => "No route to host", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ECHRNG => "Channel number out of range", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EL2NSYNC => "Level 2 not synchronized", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EL3HLT => "Level 3 halted", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EL3RST => "Level 3 reset", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELNRNG => "Link number out of range", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EUNATCH => "Protocol driver not attached", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOCSI => "No CSI structure available", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EL2HLT => "Level 2 halted", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBADE => "Invalid exchange", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBADR => "Invalid request descriptor", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EXFULL => "Exchange full", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOANO => "No anode", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBADRQC => "Invalid request code", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBADSLT => "Invalid slot", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBFONT => "Bad font file format", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOSTR => "Device not a stream", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENODATA => "No data available", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ETIME => "Timer expired", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOSR => "Out of streams resources", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENONET => "Machine is not on the network", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOPKG => "Package not installed", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EREMOTE => "Object is remote", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOLINK => "Link has been severed", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EADV => "Advertise error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ESRMNT => "Srmount error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ECOMM => "Communication error on send", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EPROTO => "Protocol error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EMULTIHOP => "Multihop attempted", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EDOTDOT => "RFS specific error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EBADMSG => "Not a data message", - - #[cfg(any(target_os = "illumos", target_os = "solaris"))] - EBADMSG => "Trying to read unreadable message", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "haiku" - ))] - EOVERFLOW => "Value too large for defined data type", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ENOTUNIQ => "Name not unique on network", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EBADFD => "File descriptor in bad state", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EREMCHG => "Remote address changed", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELIBACC => "Can not access a needed shared library", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELIBBAD => "Accessing a corrupted shared library", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELIBSCN => ".lib section in a.out corrupted", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELIBMAX => "Attempting to link in too many shared libraries", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ELIBEXEC => "Cannot exec a shared library directly", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia", - target_os = "openbsd" - ))] - EILSEQ => "Illegal byte sequence", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ERESTART => "Interrupted system call should be restarted", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - ESTRPIPE => "Streams pipe error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia" - ))] - EUSERS => "Too many users", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "netbsd", - target_os = "redox" - ))] - EOPNOTSUPP => "Operation not supported on transport endpoint", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - ESTALE => "Stale file handle", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EUCLEAN => "Structure needs cleaning", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - ENOTNAM => "Not a XENIX named type file", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - ENAVAIL => "No XENIX semaphores available", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EISNAM => "Is a named type file", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EREMOTEIO => "Remote I/O error", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EDQUOT => "Quota exceeded", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "openbsd", - target_os = "dragonfly" - ))] - ENOMEDIUM => "No medium found", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "openbsd" - ))] - EMEDIUMTYPE => "Wrong medium type", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "illumos", - target_os = "solaris", - target_os = "fuchsia", - target_os = "haiku" - ))] - ECANCELED => "Operation canceled", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - ENOKEY => "Required key not available", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EKEYEXPIRED => "Key has expired", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EKEYREVOKED => "Key has been revoked", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EKEYREJECTED => "Key was rejected by service", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] - EOWNERDEAD => "Owner died", + EPFNOSUPPORT => "Protocol family not supported", + EAFNOSUPPORT => "Address family not supported by protocol", + EADDRINUSE => "Address already in use", + EADDRNOTAVAIL => "Cannot assign requested address", + ENETDOWN => "Network is down", + ENETUNREACH => "Network is unreachable", + ENETRESET => "Network dropped connection because of reset", + ECONNABORTED => "Software caused connection abort", + ECONNRESET => "Connection reset by peer", + ENOBUFS => "No buffer space available", + EISCONN => "Transport endpoint is already connected", + ENOTCONN => "Transport endpoint is not connected", + ESHUTDOWN => "Cannot send after transport endpoint shutdown", + ETOOMANYREFS => "Too many references: cannot splice", + ETIMEDOUT => "Connection timed out", + ECONNREFUSED => "Connection refused", + EHOSTDOWN => "Host is down", + EHOSTUNREACH => "No route to host", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECHRNG => "Channel number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2NSYNC => "Level 2 not synchronized", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3HLT => "Level 3 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3RST => "Level 3 reset", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELNRNG => "Link number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUNATCH => "Protocol driver not attached", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOCSI => "No CSI structure available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2HLT => "Level 2 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADE => "Invalid exchange", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADR => "Invalid request descriptor", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EXFULL => "Exchange full", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOANO => "No anode", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADRQC => "Invalid request code", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADSLT => "Invalid slot", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBFONT => "Bad font file format", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSTR => "Device not a stream", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENODATA => "No data available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ETIME => "Timer expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSR => "Out of streams resources", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENONET => "Machine is not on the network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOPKG => "Package not installed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMOTE => "Object is remote", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOLINK => "Link has been severed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EADV => "Advertise error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESRMNT => "Srmount error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECOMM => "Communication error on send", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDOTDOT => "RFS specific error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EBADMSG => "Not a data message", #[cfg(any(target_os = "illumos", target_os = "solaris"))] - EOWNERDEAD => "Process died with lock", - - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia" - ))] + EBADMSG => "Trying to read unreadable message", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOVERFLOW => "Value too large for defined data type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOTUNIQ => "Name not unique on network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADFD => "File descriptor in bad state", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMCHG => "Remote address changed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBACC => "Can not access a needed shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBBAD => "Accessing a corrupted shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBSCN => ".lib section in a.out corrupted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBMAX => "Attempting to link in too many shared libraries", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBEXEC => "Cannot exec a shared library directly", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia", target_os = "openbsd"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ERESTART => "Interrupted system call should be restarted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESTRPIPE => "Streams pipe error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "netbsd", + target_os = "redox"))] + EOPNOTSUPP => "Operation not supported on transport endpoint", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ESTALE => "Stale file handle", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EUCLEAN => "Structure needs cleaning", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOTNAM => "Not a XENIX named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENAVAIL => "No XENIX semaphores available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EISNAM => "Is a named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EREMOTEIO => "Remote I/O error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDQUOT => "Quota exceeded", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd", + target_os = "dragonfly"))] + ENOMEDIUM => "No medium found", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd"))] + EMEDIUMTYPE => "Wrong medium type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOKEY => "Required key not available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYEXPIRED => "Key has expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREVOKED => "Key has been revoked", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREJECTED => "Key was rejected by service", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOWNERDEAD => "Owner died", + + #[cfg(any( target_os = "illumos", target_os = "solaris"))] + EOWNERDEAD => "Process died with lock", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] ENOTRECOVERABLE => "State not recoverable", #[cfg(any(target_os = "illumos", target_os = "solaris"))] ENOTRECOVERABLE => "Lock is not recoverable", - #[cfg(any( - all(target_os = "linux", not(target_arch = "mips")), - target_os = "fuchsia" - ))] - ERFKILL => "Operation not possible due to RF-kill", + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + ERFKILL => "Operation not possible due to RF-kill", - #[cfg(any( - all(target_os = "linux", not(target_arch = "mips")), - target_os = "fuchsia" - ))] - EHWPOISON => "Memory page has hardware error", + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + EHWPOISON => "Memory page has hardware error", #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] - EDOOFUS => "Programming error", - - #[cfg(any( - target_os = "freebsd", - target_os = "dragonfly", - target_os = "redox" - ))] - EMULTIHOP => "Multihop attempted", - - #[cfg(any( - target_os = "freebsd", - target_os = "dragonfly", - target_os = "redox" - ))] - ENOLINK => "Link has been severed", + EDOOFUS => "Programming error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "redox"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", + target_os = "redox"))] + ENOLINK => "Link has been severed", #[cfg(target_os = "freebsd")] - ENOTCAPABLE => "Capabilities insufficient", + ENOTCAPABLE => "Capabilities insufficient", #[cfg(target_os = "freebsd")] - ECAPMODE => "Not permitted in capability mode", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - ENEEDAUTH => "Need authenticator", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox", - target_os = "illumos", - target_os = "solaris" - ))] - EOVERFLOW => "Value too large to be stored in data type", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "netbsd", - target_os = "redox", - target_os = "haiku" - ))] - EILSEQ => "Illegal byte sequence", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "haiku" - ))] - ENOATTR => "Attribute not found", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox", - target_os = "haiku" - ))] - EBADMSG => "Bad message", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox", - target_os = "haiku" - ))] - EPROTO => "Protocol error", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd" - ))] + ECAPMODE => "Not permitted in capability mode", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENEEDAUTH => "Need authenticator", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EOVERFLOW => "Value too large to be stored in data type", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENOATTR => "Attribute not found", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EBADMSG => "Bad message", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd"))] ENOTRECOVERABLE => "State not recoverable", - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd" - ))] - EOWNERDEAD => "Previous owner died", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "illumos", - target_os = "solaris", - target_os = "haiku" - ))] - ENOTSUP => "Operation not supported", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EPROCLIM => "Too many processes", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox" - ))] - EUSERS => "Too many users", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox", - target_os = "illumos", - target_os = "solaris", - target_os = "haiku" - ))] - EDQUOT => "Disc quota exceeded", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox", - target_os = "illumos", - target_os = "solaris", - target_os = "haiku" - ))] - ESTALE => "Stale NFS file handle", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox" - ))] - EREMOTE => "Too many levels of remote in path", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EBADRPC => "RPC struct is bad", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - ERPCMISMATCH => "RPC version wrong", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EPROGUNAVAIL => "RPC prog. not avail", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EPROGMISMATCH => "Program version wrong", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EPROCUNAVAIL => "Bad procedure for program", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EFTYPE => "Inappropriate file type or format", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd" - ))] - EAUTH => "Authentication error", - - #[cfg(any( - target_os = "macos", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "ios", - target_os = "openbsd", - target_os = "netbsd", - target_os = "redox" - ))] - ECANCELED => "Operation canceled", + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd"))] + EOWNERDEAD => "Previous owner died", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "illumos", target_os = "solaris"))] + ENOTSUP => "Operation not supported", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCLIM => "Too many processes", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EDQUOT => "Disc quota exceeded", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + ESTALE => "Stale NFS file handle", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EREMOTE => "Too many levels of remote in path", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EBADRPC => "RPC struct is bad", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ERPCMISMATCH => "RPC version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGUNAVAIL => "RPC prog. not avail", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGMISMATCH => "Program version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCUNAVAIL => "Bad procedure for program", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EFTYPE => "Inappropriate file type or format", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EAUTH => "Authentication error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + ECANCELED => "Operation canceled", #[cfg(any(target_os = "macos", target_os = "ios"))] - EPWROFF => "Device power is off", + EPWROFF => "Device power is off", #[cfg(any(target_os = "macos", target_os = "ios"))] - EDEVERR => "Device error, e.g. paper out", + EDEVERR => "Device error, e.g. paper out", #[cfg(any(target_os = "macos", target_os = "ios"))] - EBADEXEC => "Bad executable", + EBADEXEC => "Bad executable", #[cfg(any(target_os = "macos", target_os = "ios"))] - EBADARCH => "Bad CPU type in executable", + EBADARCH => "Bad CPU type in executable", #[cfg(any(target_os = "macos", target_os = "ios"))] - ESHLIBVERS => "Shared library version mismatch", + ESHLIBVERS => "Shared library version mismatch", #[cfg(any(target_os = "macos", target_os = "ios"))] - EBADMACHO => "Malformed Macho file", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "haiku" - ))] - EMULTIHOP => "Reserved", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "redox" - ))] - ENODATA => "No message available on STREAM", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "haiku" - ))] - ENOLINK => "Reserved", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "redox" - ))] - ENOSR => "No STREAM resources", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "redox" - ))] - ENOSTR => "Not a STREAM", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "netbsd", - target_os = "redox" - ))] - ETIME => "STREAM ioctl timeout", - - #[cfg(any( - target_os = "macos", - target_os = "ios", - target_os = "illumos", - target_os = "solaris" - ))] - EOPNOTSUPP => "Operation not supported on socket", + EBADMACHO => "Malformed Macho file", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + EMULTIHOP => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENODATA => "No message available on STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + ENOLINK => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSR => "No STREAM resources", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSTR => "Not a STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ETIME => "STREAM ioctl timeout", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "illumos", target_os = "solaris"))] + EOPNOTSUPP => "Operation not supported on socket", #[cfg(any(target_os = "macos", target_os = "ios"))] - ENOPOLICY => "No such policy registered", + ENOPOLICY => "No such policy registered", #[cfg(any(target_os = "macos", target_os = "ios"))] - EQFULL => "Interface output queue is full", + EQFULL => "Interface output queue is full", #[cfg(target_os = "openbsd")] - EOPNOTSUPP => "Operation not supported", + EOPNOTSUPP => "Operation not supported", #[cfg(target_os = "openbsd")] - EIPSEC => "IPsec processing failure", + EIPSEC => "IPsec processing failure", #[cfg(target_os = "dragonfly")] - EASYNC => "Async", + EASYNC => "Async", #[cfg(any(target_os = "illumos", target_os = "solaris"))] - EDEADLOCK => "Resource deadlock would occur", + EDEADLOCK => "Resource deadlock would occur", #[cfg(any(target_os = "illumos", target_os = "solaris"))] - ELOCKUNMAPPED => "Locked lock was unmapped", + ELOCKUNMAPPED => "Locked lock was unmapped", #[cfg(any(target_os = "illumos", target_os = "solaris"))] - ENOTACTIVE => "Facility is not active", + ENOTACTIVE => "Facility is not active", } } -#[cfg(any(target_os = "linux", target_os = "android", target_os = "fuchsia"))] +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] mod consts { #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EAGAIN = libc::EAGAIN, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EDEADLK = libc::EDEADLK, - ENAMETOOLONG = libc::ENAMETOOLONG, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - ENOTEMPTY = libc::ENOTEMPTY, - ELOOP = libc::ELOOP, - ENOMSG = libc::ENOMSG, - EIDRM = libc::EIDRM, - ECHRNG = libc::ECHRNG, - EL2NSYNC = libc::EL2NSYNC, - EL3HLT = libc::EL3HLT, - EL3RST = libc::EL3RST, - ELNRNG = libc::ELNRNG, - EUNATCH = libc::EUNATCH, - ENOCSI = libc::ENOCSI, - EL2HLT = libc::EL2HLT, - EBADE = libc::EBADE, - EBADR = libc::EBADR, - EXFULL = libc::EXFULL, - ENOANO = libc::ENOANO, - EBADRQC = libc::EBADRQC, - EBADSLT = libc::EBADSLT, - EBFONT = libc::EBFONT, - ENOSTR = libc::ENOSTR, - ENODATA = libc::ENODATA, - ETIME = libc::ETIME, - ENOSR = libc::ENOSR, - ENONET = libc::ENONET, - ENOPKG = libc::ENOPKG, - EREMOTE = libc::EREMOTE, - ENOLINK = libc::ENOLINK, - EADV = libc::EADV, - ESRMNT = libc::ESRMNT, - ECOMM = libc::ECOMM, - EPROTO = libc::EPROTO, - EMULTIHOP = libc::EMULTIHOP, - EDOTDOT = libc::EDOTDOT, - EBADMSG = libc::EBADMSG, - EOVERFLOW = libc::EOVERFLOW, - ENOTUNIQ = libc::ENOTUNIQ, - EBADFD = libc::EBADFD, - EREMCHG = libc::EREMCHG, - ELIBACC = libc::ELIBACC, - ELIBBAD = libc::ELIBBAD, - ELIBSCN = libc::ELIBSCN, - ELIBMAX = libc::ELIBMAX, - ELIBEXEC = libc::ELIBEXEC, - EILSEQ = libc::EILSEQ, - ERESTART = libc::ERESTART, - ESTRPIPE = libc::ESTRPIPE, - EUSERS = libc::EUSERS, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EDEADLK = libc::EDEADLK, + ENAMETOOLONG = libc::ENAMETOOLONG, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + ENOTEMPTY = libc::ENOTEMPTY, + ELOOP = libc::ELOOP, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EBFONT = libc::EBFONT, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + EMULTIHOP = libc::EMULTIHOP, + EDOTDOT = libc::EDOTDOT, + EBADMSG = libc::EBADMSG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - EOPNOTSUPP = libc::EOPNOTSUPP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - EALREADY = libc::EALREADY, - EINPROGRESS = libc::EINPROGRESS, - ESTALE = libc::ESTALE, - EUCLEAN = libc::EUCLEAN, - ENOTNAM = libc::ENOTNAM, - ENAVAIL = libc::ENAVAIL, - EISNAM = libc::EISNAM, - EREMOTEIO = libc::EREMOTEIO, - EDQUOT = libc::EDQUOT, - ENOMEDIUM = libc::ENOMEDIUM, - EMEDIUMTYPE = libc::EMEDIUMTYPE, - ECANCELED = libc::ECANCELED, - ENOKEY = libc::ENOKEY, - EKEYEXPIRED = libc::EKEYEXPIRED, - EKEYREVOKED = libc::EKEYREVOKED, - EKEYREJECTED = libc::EKEYREJECTED, - EOWNERDEAD = libc::EOWNERDEAD, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + EUCLEAN = libc::EUCLEAN, + ENOTNAM = libc::ENOTNAM, + ENAVAIL = libc::ENAVAIL, + EISNAM = libc::EISNAM, + EREMOTEIO = libc::EREMOTEIO, + EDQUOT = libc::EDQUOT, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + ECANCELED = libc::ECANCELED, + ENOKEY = libc::ENOKEY, + EKEYEXPIRED = libc::EKEYEXPIRED, + EKEYREVOKED = libc::EKEYREVOKED, + EKEYREJECTED = libc::EKEYREJECTED, + EOWNERDEAD = libc::EOWNERDEAD, ENOTRECOVERABLE = libc::ENOTRECOVERABLE, - #[cfg(not(any(target_os = "android", target_arch = "mips")))] - ERFKILL = libc::ERFKILL, - #[cfg(not(any(target_os = "android", target_arch = "mips")))] - EHWPOISON = libc::EHWPOISON, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + ERFKILL = libc::ERFKILL, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + EHWPOISON = libc::EHWPOISON, } #[deprecated( @@ -1306,17 +919,17 @@ mod consts { since = "0.22.1", note = "use nix::errno::Errno::EDEADLOCK instead" )] - pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EDEADLOCK: Errno = Errno::EDEADLK; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ENOTSUP instead" )] - pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; impl Errno { pub const EWOULDBLOCK: Errno = Errno::EAGAIN; - pub const EDEADLOCK: Errno = Errno::EDEADLK; - pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; } pub const fn from_i32(e: i32) -> Errno { @@ -1452,11 +1065,11 @@ mod consts { libc::EKEYREJECTED => EKEYREJECTED, libc::EOWNERDEAD => EOWNERDEAD, libc::ENOTRECOVERABLE => ENOTRECOVERABLE, - #[cfg(not(any(target_os = "android", target_arch = "mips")))] + #[cfg(not(any(target_os = "android", target_arch="mips")))] libc::ERFKILL => ERFKILL, - #[cfg(not(any(target_os = "android", target_arch = "mips")))] + #[cfg(not(any(target_os = "android", target_arch="mips")))] libc::EHWPOISON => EHWPOISON, - _ => UnknownErrno, + _ => UnknownErrno, } } } @@ -1467,120 +1080,120 @@ mod consts { #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - ENOTSUP = libc::ENOTSUP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EPROCLIM = libc::EPROCLIM, - EUSERS = libc::EUSERS, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - EREMOTE = libc::EREMOTE, - EBADRPC = libc::EBADRPC, - ERPCMISMATCH = libc::ERPCMISMATCH, - EPROGUNAVAIL = libc::EPROGUNAVAIL, - EPROGMISMATCH = libc::EPROGMISMATCH, - EPROCUNAVAIL = libc::EPROCUNAVAIL, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EFTYPE = libc::EFTYPE, - EAUTH = libc::EAUTH, - ENEEDAUTH = libc::ENEEDAUTH, - EPWROFF = libc::EPWROFF, - EDEVERR = libc::EDEVERR, - EOVERFLOW = libc::EOVERFLOW, - EBADEXEC = libc::EBADEXEC, - EBADARCH = libc::EBADARCH, - ESHLIBVERS = libc::ESHLIBVERS, - EBADMACHO = libc::EBADMACHO, - ECANCELED = libc::ECANCELED, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - EILSEQ = libc::EILSEQ, - ENOATTR = libc::ENOATTR, - EBADMSG = libc::EBADMSG, - EMULTIHOP = libc::EMULTIHOP, - ENODATA = libc::ENODATA, - ENOLINK = libc::ENOLINK, - ENOSR = libc::ENOSR, - ENOSTR = libc::ENOSTR, - EPROTO = libc::EPROTO, - ETIME = libc::ETIME, - EOPNOTSUPP = libc::EOPNOTSUPP, - ENOPOLICY = libc::ENOPOLICY, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EPWROFF = libc::EPWROFF, + EDEVERR = libc::EDEVERR, + EOVERFLOW = libc::EOVERFLOW, + EBADEXEC = libc::EBADEXEC, + EBADARCH = libc::EBADARCH, + ESHLIBVERS = libc::ESHLIBVERS, + EBADMACHO = libc::EBADMACHO, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENODATA = libc::ENODATA, + ENOLINK = libc::ENOLINK, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + EPROTO = libc::EPROTO, + ETIME = libc::ETIME, + EOPNOTSUPP = libc::EOPNOTSUPP, + ENOPOLICY = libc::ENOPOLICY, ENOTRECOVERABLE = libc::ENOTRECOVERABLE, - EOWNERDEAD = libc::EOWNERDEAD, - EQFULL = libc::EQFULL, + EOWNERDEAD = libc::EOWNERDEAD, + EQFULL = libc::EQFULL, } #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ELAST instead" )] - pub const ELAST: Errno = Errno::EQFULL; + pub const ELAST: Errno = Errno::EQFULL; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EWOULDBLOCK instead" @@ -1590,12 +1203,12 @@ mod consts { since = "0.22.1", note = "use nix::errno::Errno::EDEADLOCK instead" )] - pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EDEADLOCK: Errno = Errno::EDEADLK; impl Errno { - pub const ELAST: Errno = Errno::EQFULL; + pub const ELAST: Errno = Errno::EQFULL; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; - pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EDEADLOCK: Errno = Errno::EDEADLK; } pub const fn from_i32(e: i32) -> Errno { @@ -1708,7 +1321,7 @@ mod consts { libc::ENOTRECOVERABLE => ENOTRECOVERABLE, libc::EOWNERDEAD => EOWNERDEAD, libc::EQFULL => EQFULL, - _ => UnknownErrno, + _ => UnknownErrno, } } } @@ -1719,110 +1332,110 @@ mod consts { #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - ENOTSUP = libc::ENOTSUP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EPROCLIM = libc::EPROCLIM, - EUSERS = libc::EUSERS, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - EREMOTE = libc::EREMOTE, - EBADRPC = libc::EBADRPC, - ERPCMISMATCH = libc::ERPCMISMATCH, - EPROGUNAVAIL = libc::EPROGUNAVAIL, - EPROGMISMATCH = libc::EPROGMISMATCH, - EPROCUNAVAIL = libc::EPROCUNAVAIL, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EFTYPE = libc::EFTYPE, - EAUTH = libc::EAUTH, - ENEEDAUTH = libc::ENEEDAUTH, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - EOVERFLOW = libc::EOVERFLOW, - ECANCELED = libc::ECANCELED, - EILSEQ = libc::EILSEQ, - ENOATTR = libc::ENOATTR, - EDOOFUS = libc::EDOOFUS, - EBADMSG = libc::EBADMSG, - EMULTIHOP = libc::EMULTIHOP, - ENOLINK = libc::ENOLINK, - EPROTO = libc::EPROTO, - ENOTCAPABLE = libc::ENOTCAPABLE, - ECAPMODE = libc::ECAPMODE, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOTCAPABLE = libc::ENOTCAPABLE, + ECAPMODE = libc::ECAPMODE, ENOTRECOVERABLE = libc::ENOTRECOVERABLE, - EOWNERDEAD = libc::EOWNERDEAD, + EOWNERDEAD = libc::EOWNERDEAD, } #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ELAST instead" )] - pub const ELAST: Errno = Errno::EOWNERDEAD; + pub const ELAST: Errno = Errno::EOWNERDEAD; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EWOULDBLOCK instead" @@ -1832,18 +1445,18 @@ mod consts { since = "0.22.1", note = "use nix::errno::Errno::EDEADLOCK instead" )] - pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EDEADLOCK: Errno = Errno::EDEADLK; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EOPNOTSUPP instead" )] - pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; impl Errno { - pub const ELAST: Errno = Errno::EOWNERDEAD; + pub const ELAST: Errno = Errno::EOWNERDEAD; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; - pub const EDEADLOCK: Errno = Errno::EDEADLK; - pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; } pub const fn from_i32(e: i32) -> Errno { @@ -1946,121 +1559,122 @@ mod consts { libc::ECAPMODE => ECAPMODE, libc::ENOTRECOVERABLE => ENOTRECOVERABLE, libc::EOWNERDEAD => EOWNERDEAD, - _ => UnknownErrno, + _ => UnknownErrno, } } } + #[cfg(target_os = "dragonfly")] mod consts { #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - ENOTSUP = libc::ENOTSUP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EPROCLIM = libc::EPROCLIM, - EUSERS = libc::EUSERS, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - EREMOTE = libc::EREMOTE, - EBADRPC = libc::EBADRPC, - ERPCMISMATCH = libc::ERPCMISMATCH, - EPROGUNAVAIL = libc::EPROGUNAVAIL, - EPROGMISMATCH = libc::EPROGMISMATCH, - EPROCUNAVAIL = libc::EPROCUNAVAIL, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EFTYPE = libc::EFTYPE, - EAUTH = libc::EAUTH, - ENEEDAUTH = libc::ENEEDAUTH, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - EOVERFLOW = libc::EOVERFLOW, - ECANCELED = libc::ECANCELED, - EILSEQ = libc::EILSEQ, - ENOATTR = libc::ENOATTR, - EDOOFUS = libc::EDOOFUS, - EBADMSG = libc::EBADMSG, - EMULTIHOP = libc::EMULTIHOP, - ENOLINK = libc::ENOLINK, - EPROTO = libc::EPROTO, - ENOMEDIUM = libc::ENOMEDIUM, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOMEDIUM = libc::ENOMEDIUM, ENOTRECOVERABLE = libc::ENOTRECOVERABLE, - EOWNERDEAD = libc::EOWNERDEAD, - EASYNC = libc::EASYNC, + EOWNERDEAD = libc::EOWNERDEAD, + EASYNC = libc::EASYNC, } #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ELAST instead" )] - pub const ELAST: Errno = Errno::EASYNC; + pub const ELAST: Errno = Errno::EASYNC; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EWOULDBLOCK instead" @@ -2070,18 +1684,18 @@ mod consts { since = "0.22.1", note = "use nix::errno::Errno::EDEADLOCK instead" )] - pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EDEADLOCK: Errno = Errno::EDEADLK; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EOPNOTSUPP instead" )] - pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; impl Errno { - pub const ELAST: Errno = Errno::EASYNC; + pub const ELAST: Errno = Errno::EASYNC; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; - pub const EDEADLOCK: Errno = Errno::EDEADLK; - pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; } pub const fn from_i32(e: i32) -> Errno { @@ -2108,7 +1722,7 @@ mod consts { libc::EXDEV => EXDEV, libc::ENODEV => ENODEV, libc::ENOTDIR => ENOTDIR, - libc::EISDIR => EISDIR, + libc::EISDIR=> EISDIR, libc::EINVAL => EINVAL, libc::ENFILE => ENFILE, libc::EMFILE => EMFILE, @@ -2182,120 +1796,121 @@ mod consts { libc::EPROTO => EPROTO, libc::ENOMEDIUM => ENOMEDIUM, libc::EASYNC => EASYNC, - _ => UnknownErrno, + _ => UnknownErrno, } } } + #[cfg(target_os = "openbsd")] mod consts { #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - EOPNOTSUPP = libc::EOPNOTSUPP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EPROCLIM = libc::EPROCLIM, - EUSERS = libc::EUSERS, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - EREMOTE = libc::EREMOTE, - EBADRPC = libc::EBADRPC, - ERPCMISMATCH = libc::ERPCMISMATCH, - EPROGUNAVAIL = libc::EPROGUNAVAIL, - EPROGMISMATCH = libc::EPROGMISMATCH, - EPROCUNAVAIL = libc::EPROCUNAVAIL, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EFTYPE = libc::EFTYPE, - EAUTH = libc::EAUTH, - ENEEDAUTH = libc::ENEEDAUTH, - EIPSEC = libc::EIPSEC, - ENOATTR = libc::ENOATTR, - EILSEQ = libc::EILSEQ, - ENOMEDIUM = libc::ENOMEDIUM, - EMEDIUMTYPE = libc::EMEDIUMTYPE, - EOVERFLOW = libc::EOVERFLOW, - ECANCELED = libc::ECANCELED, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - ENOTSUP = libc::ENOTSUP, - EBADMSG = libc::EBADMSG, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIPSEC = libc::EIPSEC, + ENOATTR = libc::ENOATTR, + EILSEQ = libc::EILSEQ, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + ENOTSUP = libc::ENOTSUP, + EBADMSG = libc::EBADMSG, ENOTRECOVERABLE = libc::ENOTRECOVERABLE, - EOWNERDEAD = libc::EOWNERDEAD, - EPROTO = libc::EPROTO, + EOWNERDEAD = libc::EOWNERDEAD, + EPROTO = libc::EPROTO, } #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ELAST instead" )] - pub const ELAST: Errno = Errno::ENOTSUP; + pub const ELAST: Errno = Errno::ENOTSUP; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EWOULDBLOCK instead" @@ -2303,7 +1918,7 @@ mod consts { pub const EWOULDBLOCK: Errno = Errno::EAGAIN; impl Errno { - pub const ELAST: Errno = Errno::ENOTSUP; + pub const ELAST: Errno = Errno::ENOTSUP; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; } @@ -2406,7 +2021,7 @@ mod consts { libc::ENOTRECOVERABLE => ENOTRECOVERABLE, libc::EOWNERDEAD => EOWNERDEAD, libc::EPROTO => EPROTO, - _ => UnknownErrno, + _ => UnknownErrno, } } } @@ -2417,110 +2032,110 @@ mod consts { #[repr(i32)] #[non_exhaustive] pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - ENOTBLK = libc::ENOTBLK, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, EPROTONOSUPPORT = libc::EPROTONOSUPPORT, ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, - EOPNOTSUPP = libc::EOPNOTSUPP, - EPFNOSUPPORT = libc::EPFNOSUPPORT, - EAFNOSUPPORT = libc::EAFNOSUPPORT, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETOOMANYREFS = libc::ETOOMANYREFS, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EPROCLIM = libc::EPROCLIM, - EUSERS = libc::EUSERS, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - EREMOTE = libc::EREMOTE, - EBADRPC = libc::EBADRPC, - ERPCMISMATCH = libc::ERPCMISMATCH, - EPROGUNAVAIL = libc::EPROGUNAVAIL, - EPROGMISMATCH = libc::EPROGMISMATCH, - EPROCUNAVAIL = libc::EPROCUNAVAIL, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EFTYPE = libc::EFTYPE, - EAUTH = libc::EAUTH, - ENEEDAUTH = libc::ENEEDAUTH, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - EOVERFLOW = libc::EOVERFLOW, - EILSEQ = libc::EILSEQ, - ENOTSUP = libc::ENOTSUP, - ECANCELED = libc::ECANCELED, - EBADMSG = libc::EBADMSG, - ENODATA = libc::ENODATA, - ENOSR = libc::ENOSR, - ENOSTR = libc::ENOSTR, - ETIME = libc::ETIME, - ENOATTR = libc::ENOATTR, - EMULTIHOP = libc::EMULTIHOP, - ENOLINK = libc::ENOLINK, - EPROTO = libc::EPROTO, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ENOTSUP = libc::ENOTSUP, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + ENOATTR = libc::ENOATTR, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, } #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::ELAST instead" )] - pub const ELAST: Errno = Errno::ENOTSUP; + pub const ELAST: Errno = Errno::ENOTSUP; #[deprecated( since = "0.22.1", note = "use nix::errno::Errno::EWOULDBLOCK instead" @@ -2528,7 +2143,7 @@ mod consts { pub const EWOULDBLOCK: Errno = Errno::EAGAIN; impl Errno { - pub const ELAST: Errno = Errno::ENOTSUP; + pub const ELAST: Errno = Errno::ENOTSUP; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; } @@ -2632,7 +2247,7 @@ mod consts { libc::EMULTIHOP => EMULTIHOP, libc::ENOLINK => ENOLINK, libc::EPROTO => EPROTO, - _ => UnknownErrno, + _ => UnknownErrno, } } } @@ -2977,7 +2592,7 @@ mod consts { pub const EWOULDBLOCK: Errno = Errno::EAGAIN; impl Errno { - pub const ELAST: Errno = Errno::ESTALE; + pub const ELAST: Errno = Errno::ESTALE; pub const EWOULDBLOCK: Errno = Errno::EAGAIN; } @@ -3110,177 +2725,3 @@ mod consts { } } } - -#[cfg(target_os = "haiku")] -mod consts { - #[derive(Clone, Copy, Debug, Eq, PartialEq)] - #[repr(i32)] - #[non_exhaustive] - pub enum Errno { - UnknownErrno = 0, - EPERM = libc::EPERM, - ENOENT = libc::ENOENT, - ESRCH = libc::ESRCH, - EINTR = libc::EINTR, - EIO = libc::EIO, - ENXIO = libc::ENXIO, - E2BIG = libc::E2BIG, - ENOEXEC = libc::ENOEXEC, - EBADF = libc::EBADF, - ECHILD = libc::ECHILD, - EDEADLK = libc::EDEADLK, - ENOMEM = libc::ENOMEM, - EACCES = libc::EACCES, - EFAULT = libc::EFAULT, - EBUSY = libc::EBUSY, - EEXIST = libc::EEXIST, - EXDEV = libc::EXDEV, - ENODEV = libc::ENODEV, - ENOTDIR = libc::ENOTDIR, - EISDIR = libc::EISDIR, - EINVAL = libc::EINVAL, - ENFILE = libc::ENFILE, - EMFILE = libc::EMFILE, - ENOTTY = libc::ENOTTY, - ETXTBSY = libc::ETXTBSY, - EFBIG = libc::EFBIG, - ENOSPC = libc::ENOSPC, - ESPIPE = libc::ESPIPE, - EROFS = libc::EROFS, - EMLINK = libc::EMLINK, - EPIPE = libc::EPIPE, - EDOM = libc::EDOM, - ERANGE = libc::ERANGE, - EAGAIN = libc::EAGAIN, - EINPROGRESS = libc::EINPROGRESS, - EALREADY = libc::EALREADY, - ENOTSOCK = libc::ENOTSOCK, - EDESTADDRREQ = libc::EDESTADDRREQ, - EMSGSIZE = libc::EMSGSIZE, - EPROTOTYPE = libc::EPROTOTYPE, - ENOPROTOOPT = libc::ENOPROTOOPT, - EPROTONOSUPPORT = libc::EPROTONOSUPPORT, - ENOTSUP = libc::ENOTSUP, - EADDRINUSE = libc::EADDRINUSE, - EADDRNOTAVAIL = libc::EADDRNOTAVAIL, - ENETDOWN = libc::ENETDOWN, - ENETUNREACH = libc::ENETUNREACH, - ENETRESET = libc::ENETRESET, - ECONNABORTED = libc::ECONNABORTED, - ECONNRESET = libc::ECONNRESET, - ENOBUFS = libc::ENOBUFS, - EISCONN = libc::EISCONN, - ENOTCONN = libc::ENOTCONN, - ESHUTDOWN = libc::ESHUTDOWN, - ETIMEDOUT = libc::ETIMEDOUT, - ECONNREFUSED = libc::ECONNREFUSED, - ELOOP = libc::ELOOP, - ENAMETOOLONG = libc::ENAMETOOLONG, - EHOSTDOWN = libc::EHOSTDOWN, - EHOSTUNREACH = libc::EHOSTUNREACH, - ENOTEMPTY = libc::ENOTEMPTY, - EDQUOT = libc::EDQUOT, - ESTALE = libc::ESTALE, - ENOLCK = libc::ENOLCK, - ENOSYS = libc::ENOSYS, - EIDRM = libc::EIDRM, - ENOMSG = libc::ENOMSG, - EOVERFLOW = libc::EOVERFLOW, - ECANCELED = libc::ECANCELED, - EILSEQ = libc::EILSEQ, - ENOATTR = libc::ENOATTR, - EBADMSG = libc::EBADMSG, - EMULTIHOP = libc::EMULTIHOP, - ENOLINK = libc::ENOLINK, - EPROTO = libc::EPROTO, - } - - impl Errno { - pub const EWOULDBLOCK: Errno = Errno::EAGAIN; - pub const EDEADLOCK: Errno = Errno::EDEADLK; - pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; - } - - pub const fn from_i32(e: i32) -> Errno { - use self::Errno::*; - - match e { - libc::EPERM => EPERM, - libc::ENOENT => ENOENT, - libc::ESRCH => ESRCH, - libc::EINTR => EINTR, - libc::EIO => EIO, - libc::ENXIO => ENXIO, - libc::E2BIG => E2BIG, - libc::ENOEXEC => ENOEXEC, - libc::EBADF => EBADF, - libc::ECHILD => ECHILD, - libc::EDEADLK => EDEADLK, - libc::ENOMEM => ENOMEM, - libc::EACCES => EACCES, - libc::EFAULT => EFAULT, - libc::EBUSY => EBUSY, - libc::EEXIST => EEXIST, - libc::EXDEV => EXDEV, - libc::ENODEV => ENODEV, - libc::ENOTDIR => ENOTDIR, - libc::EISDIR => EISDIR, - libc::EINVAL => EINVAL, - libc::ENFILE => ENFILE, - libc::EMFILE => EMFILE, - libc::ENOTTY => ENOTTY, - libc::ETXTBSY => ETXTBSY, - libc::EFBIG => EFBIG, - libc::ENOSPC => ENOSPC, - libc::ESPIPE => ESPIPE, - libc::EROFS => EROFS, - libc::EMLINK => EMLINK, - libc::EPIPE => EPIPE, - libc::EDOM => EDOM, - libc::ERANGE => ERANGE, - libc::EAGAIN => EAGAIN, - libc::EINPROGRESS => EINPROGRESS, - libc::EALREADY => EALREADY, - libc::ENOTSOCK => ENOTSOCK, - libc::EDESTADDRREQ => EDESTADDRREQ, - libc::EMSGSIZE => EMSGSIZE, - libc::EPROTOTYPE => EPROTOTYPE, - libc::ENOPROTOOPT => ENOPROTOOPT, - libc::EPROTONOSUPPORT => EPROTONOSUPPORT, - libc::ENOTSUP => ENOTSUP, - libc::EADDRINUSE => EADDRINUSE, - libc::EADDRNOTAVAIL => EADDRNOTAVAIL, - libc::ENETDOWN => ENETDOWN, - libc::ENETUNREACH => ENETUNREACH, - libc::ENETRESET => ENETRESET, - libc::ECONNABORTED => ECONNABORTED, - libc::ECONNRESET => ECONNRESET, - libc::ENOBUFS => ENOBUFS, - libc::EISCONN => EISCONN, - libc::ENOTCONN => ENOTCONN, - libc::ESHUTDOWN => ESHUTDOWN, - libc::ETIMEDOUT => ETIMEDOUT, - libc::ECONNREFUSED => ECONNREFUSED, - libc::ELOOP => ELOOP, - libc::ENAMETOOLONG => ENAMETOOLONG, - libc::EHOSTDOWN => EHOSTDOWN, - libc::EHOSTUNREACH => EHOSTUNREACH, - libc::ENOTEMPTY => ENOTEMPTY, - libc::EDQUOT => EDQUOT, - libc::ESTALE => ESTALE, - libc::ENOLCK => ENOLCK, - libc::ENOSYS => ENOSYS, - libc::EIDRM => EIDRM, - libc::ENOMSG => ENOMSG, - libc::EOVERFLOW => EOVERFLOW, - libc::ECANCELED => ECANCELED, - libc::EILSEQ => EILSEQ, - libc::ENOATTR => ENOATTR, - libc::EBADMSG => EBADMSG, - libc::EMULTIHOP => EMULTIHOP, - libc::ENOLINK => ENOLINK, - libc::EPROTO => EPROTO, - _ => UnknownErrno, - } - } -} diff --git a/bash-5.1/vendor/nix/src/fcntl.rs b/bash-5.1/vendor/nix/src/fcntl.rs index 160b022d77add56cd119862b4c74d2af50e81462..fa64c8eaede5790d56c52a69965e85dde8ddf6f6 100644 --- a/bash-5.1/vendor/nix/src/fcntl.rs +++ b/bash-5.1/vendor/nix/src/fcntl.rs @@ -6,22 +6,26 @@ use std::os::raw; use std::os::unix::ffi::OsStringExt; use std::os::unix::io::RawFd; -#[cfg(feature = "fs")] -use crate::{sys::stat::Mode, NixPath, Result}; #[cfg(any(target_os = "android", target_os = "linux"))] use std::ptr; // For splice and copy_file_range +#[cfg(feature = "fs")] +use crate::{ + NixPath, + Result, + sys::stat::Mode +}; #[cfg(any( target_os = "linux", target_os = "android", target_os = "emscripten", target_os = "fuchsia", - target_os = "wasi", + any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", target_os = "freebsd" ))] #[cfg(feature = "fs")] -pub use self::posix_fadvise::{posix_fadvise, PosixFadviseAdvice}; +pub use self::posix_fadvise::{PosixFadviseAdvice, posix_fadvise}; #[cfg(not(target_os = "redox"))] #[cfg(any(feature = "fs", feature = "process"))] @@ -54,7 +58,7 @@ libc_bitflags!( /// Open the file in append-only mode. O_APPEND; /// Generate a signal when input or output becomes possible. - #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] #[cfg_attr(docsrs, doc(cfg(all())))] O_ASYNC; /// Closes the file descriptor once an `execve` call is made. @@ -124,7 +128,7 @@ libc_bitflags!( #[cfg_attr(docsrs, doc(cfg(all())))] O_NOCTTY; /// Same as `O_NONBLOCK`. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] O_NDELAY; /// `open()` will fail if the given path is a symbolic link. @@ -237,7 +241,10 @@ pub fn renameat( } } -#[cfg(all(target_os = "linux", target_env = "gnu",))] +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] #[cfg(feature = "fs")] libc_bitflags! { #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] @@ -378,7 +385,7 @@ pub(crate) fn at_rawfd(fd: Option) -> raw::c_int { } } -#[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] +#[cfg(any(target_os = "android", target_os = "linux"))] #[cfg(feature = "fs")] libc_bitflags!( /// Additional flags for file sealing, which allows for limiting operations on a file. @@ -427,9 +434,9 @@ pub enum FcntlArg<'a> { F_OFD_SETLKW(&'a libc::flock), #[cfg(any(target_os = "linux", target_os = "android"))] F_OFD_GETLK(&'a mut libc::flock), - #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + #[cfg(any(target_os = "android", target_os = "linux"))] F_ADD_SEALS(SealFlag), - #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + #[cfg(any(target_os = "android", target_os = "linux"))] F_GET_SEALS, #[cfg(any(target_os = "macos", target_os = "ios"))] F_FULLFSYNC, @@ -475,9 +482,9 @@ pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result { F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock), #[cfg(any(target_os = "android", target_os = "linux"))] F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock), - #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + #[cfg(any(target_os = "android", target_os = "linux"))] F_ADD_SEALS(flag) => libc::fcntl(fd, libc::F_ADD_SEALS, flag.bits()), - #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + #[cfg(any(target_os = "android", target_os = "linux"))] F_GET_SEALS => libc::fcntl(fd, libc::F_GET_SEALS), #[cfg(any(target_os = "macos", target_os = "ios"))] F_FULLFSYNC => libc::fcntl(fd, libc::F_FULLFSYNC), @@ -735,8 +742,8 @@ impl SpacectlRange { /// /// # Example /// -#[cfg_attr(fbsd14, doc = " ```")] -#[cfg_attr(not(fbsd14), doc = " ```no_run")] +// no_run because it fails to link until FreeBSD 14.0 +/// ```no_run /// # use std::io::Write; /// # use std::os::unix::fs::FileExt; /// # use std::os::unix::io::AsRawFd; @@ -781,8 +788,8 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result { /// /// # Example /// -#[cfg_attr(fbsd14, doc = " ```")] -#[cfg_attr(not(fbsd14), doc = " ```no_run")] +// no_run because it fails to link until FreeBSD 14.0 +/// ```no_run /// # use std::io::Write; /// # use std::os::unix::fs::FileExt; /// # use std::os::unix::io::AsRawFd; @@ -821,7 +828,7 @@ pub fn fspacectl_all(fd: RawFd, offset: libc::off_t, len: libc::off_t) target_os = "android", target_os = "emscripten", target_os = "fuchsia", - target_os = "wasi", + any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", target_os = "freebsd" ))] @@ -870,7 +877,7 @@ mod posix_fadvise { target_os = "dragonfly", target_os = "emscripten", target_os = "fuchsia", - target_os = "wasi", + any(target_os = "wasi", target_env = "wasi"), target_os = "freebsd" ))] pub fn posix_fallocate(fd: RawFd, offset: libc::off_t, len: libc::off_t) -> Result<()> { diff --git a/bash-5.1/vendor/nix/src/features.rs b/bash-5.1/vendor/nix/src/features.rs index d2adc1693b665872234fad433c0589c56e8f2910..610809861058bc0bf6ab1c87ea29bfa9db308aba 100644 --- a/bash-5.1/vendor/nix/src/features.rs +++ b/bash-5.1/vendor/nix/src/features.rs @@ -114,7 +114,6 @@ mod os { #[cfg(any(target_os = "macos", target_os = "ios", target_os = "fuchsia", - target_os = "haiku", target_os = "solaris"))] mod os { /// Check if the OS supports atomic close-on-exec for sockets diff --git a/bash-5.1/vendor/nix/src/lib.rs b/bash-5.1/vendor/nix/src/lib.rs index 770258dd362631079a9462dd6dea9e521ac74768..d4dcbc4ceb48b4589dab2a7f0b52b0636a004cc6 100644 --- a/bash-5.1/vendor/nix/src/lib.rs +++ b/bash-5.1/vendor/nix/src/lib.rs @@ -52,20 +52,20 @@ #![deny(missing_copy_implementations)] #![deny(missing_debug_implementations)] #![warn(missing_docs)] + #![cfg_attr(docsrs, feature(doc_cfg))] -#![deny(clippy::cast_ptr_alignment)] // Re-exported external crates pub use libc; // Private internal modules -#[macro_use] -mod macros; +#[macro_use] mod macros; // Public crates #[cfg(not(target_os = "redox"))] feature! { #![feature = "dir"] + #[allow(missing_docs)] pub mod dir; } feature! { @@ -100,25 +100,28 @@ feature! { #[deny(missing_docs)] pub mod net; } -#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(any(target_os = "android", + target_os = "linux"))] feature! { #![feature = "kmod"] #[allow(missing_docs)] pub mod kmod; } -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "linux"))] feature! { #![feature = "mount"] pub mod mount; } -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "netbsd" -))] +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] feature! { #![feature = "mqueue"] + #[allow(missing_docs)] pub mod mqueue; } feature! { @@ -143,10 +146,9 @@ feature! { } // This can be implemented for other platforms as soon as libc // provides bindings for them. -#[cfg(all( - target_os = "linux", - any(target_arch = "s390x", target_arch = "x86", target_arch = "x86_64") -))] +#[cfg(all(target_os = "linux", + any(target_arch = "s390x", target_arch = "x86", + target_arch = "x86_64")))] feature! { #![feature = "ucontext"] #[allow(missing_docs)] @@ -190,8 +192,7 @@ pub trait NixPath { /// /// Mostly used internally by Nix. fn with_nix_path(&self, f: F) -> Result - where - F: FnOnce(&CStr) -> T; + where F: FnOnce(&CStr) -> T; } impl NixPath for str { @@ -204,11 +205,9 @@ impl NixPath for str { } fn with_nix_path(&self, f: F) -> Result - where - F: FnOnce(&CStr) -> T, - { - OsStr::new(self).with_nix_path(f) - } + where F: FnOnce(&CStr) -> T { + OsStr::new(self).with_nix_path(f) + } } impl NixPath for OsStr { @@ -221,11 +220,9 @@ impl NixPath for OsStr { } fn with_nix_path(&self, f: F) -> Result - where - F: FnOnce(&CStr) -> T, - { - self.as_bytes().with_nix_path(f) - } + where F: FnOnce(&CStr) -> T { + self.as_bytes().with_nix_path(f) + } } impl NixPath for CStr { @@ -278,9 +275,7 @@ impl NixPath for [u8] { buf_ptr.add(self.len()).write(0); } - match CStr::from_bytes_with_nul(unsafe { - slice::from_raw_parts(buf_ptr, self.len() + 1) - }) { + match CStr::from_bytes_with_nul(unsafe { slice::from_raw_parts(buf_ptr, self.len() + 1) }) { Ok(s) => Ok(f(s)), Err(_) => Err(Errno::EINVAL), } @@ -308,10 +303,7 @@ impl NixPath for Path { NixPath::len(self.as_os_str()) } - fn with_nix_path(&self, f: F) -> Result - where - F: FnOnce(&CStr) -> T, - { + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { self.as_os_str().with_nix_path(f) } } @@ -325,10 +317,7 @@ impl NixPath for PathBuf { NixPath::len(self.as_os_str()) } - fn with_nix_path(&self, f: F) -> Result - where - F: FnOnce(&CStr) -> T, - { + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { self.as_os_str().with_nix_path(f) } } diff --git a/bash-5.1/vendor/nix/src/macros.rs b/bash-5.1/vendor/nix/src/macros.rs index 99e0de88662fbeb77372a6c686ba5005dddcc1ba..c357a0636c48c9d806af3a4ab6edc2b8e5a0382a 100644 --- a/bash-5.1/vendor/nix/src/macros.rs +++ b/bash-5.1/vendor/nix/src/macros.rs @@ -19,7 +19,7 @@ macro_rules! feature { /// The `libc` crate must be in scope with the name `libc`. /// /// # Example -/// ```ignore +/// ``` /// libc_bitflags!{ /// pub struct ProtFlags: libc::c_int { /// PROT_NONE; @@ -39,7 +39,7 @@ macro_rules! feature { /// various flags have different types, so we cast the broken ones to the right /// type. /// -/// ```ignore +/// ``` /// libc_bitflags!{ /// pub struct SaFlags: libc::c_ulong { /// SA_NOCLDSTOP as libc::c_ulong; @@ -80,7 +80,7 @@ macro_rules! libc_bitflags { /// The `libc` crate must be in scope with the name `libc`. /// /// # Example -/// ```ignore +/// ``` /// libc_enum!{ /// pub enum ProtFlags { /// PROT_NONE, @@ -94,9 +94,6 @@ macro_rules! libc_bitflags { /// } /// } /// ``` -// Some targets don't use all rules. -#[allow(unknown_lints)] -#[allow(unused_macro_rules)] macro_rules! libc_enum { // Exit rule. (@make_enum diff --git a/bash-5.1/vendor/nix/src/mount/bsd.rs b/bash-5.1/vendor/nix/src/mount/bsd.rs index 109522f9fbc25b7d3ca88f46028791871508535c..b4d611ee39989e0897397710a47a5fd89603f2cc 100644 --- a/bash-5.1/vendor/nix/src/mount/bsd.rs +++ b/bash-5.1/vendor/nix/src/mount/bsd.rs @@ -168,9 +168,8 @@ pub type NmountResult = std::result::Result<(), NmountError>; /// To mount `target` onto `mountpoint` with `nullfs`: /// ``` /// # use nix::unistd::Uid; -/// # use ::sysctl::{CtlValue, Sysctl}; -/// # let ctl = ::sysctl::Ctl::new("vfs.usermount").unwrap(); -/// # if !Uid::current().is_root() && CtlValue::Int(0) == ctl.value().unwrap() { +/// # use ::sysctl::CtlValue; +/// # if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() { /// # return; /// # }; /// use nix::mount::{MntFlags, Nmount, unmount}; diff --git a/bash-5.1/vendor/nix/src/mqueue.rs b/bash-5.1/vendor/nix/src/mqueue.rs index e3c0c43eeef2fc96bbc9c3c70ac15ad80f701c35..792a5d229398f622e9d68012dbe23730e1c7f457 100644 --- a/bash-5.1/vendor/nix/src/mqueue.rs +++ b/bash-5.1/vendor/nix/src/mqueue.rs @@ -39,29 +39,23 @@ use crate::sys::stat::Mode; use std::mem; libc_bitflags!{ - /// Used with [`mq_open`]. pub struct MQ_OFlag: libc::c_int { - /// Open the message queue for receiving messages. O_RDONLY; - /// Open the queue for sending messages. O_WRONLY; - /// Open the queue for both receiving and sending messages O_RDWR; - /// Create a message queue. O_CREAT; - /// If set along with `O_CREAT`, `mq_open` will fail if the message - /// queue name exists. O_EXCL; - /// `mq_send` and `mq_receive` should fail with `EAGAIN` rather than - /// wait for resources that are not currently available. O_NONBLOCK; - /// Set the close-on-exec flag for the message queue descriptor. O_CLOEXEC; } } -/// A message-queue attribute, optionally used with [`mq_setattr`] and -/// [`mq_getattr`] and optionally [`mq_open`], +libc_bitflags!{ + pub struct FdFlag: libc::c_int { + FD_CLOEXEC; + } +} + #[repr(C)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct MqAttr { @@ -78,24 +72,14 @@ pub struct MqdT(mqd_t); // x32 compatibility // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 -/// Size of a message queue attribute member #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[cfg_attr(docsrs, doc(cfg(all())))] pub type mq_attr_member_t = i64; -/// Size of a message queue attribute member #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] #[cfg_attr(docsrs, doc(cfg(all())))] pub type mq_attr_member_t = libc::c_long; impl MqAttr { - /// Create a new message queue attribute - /// - /// # Arguments - /// - /// - `mq_flags`: Either `0` or `O_NONBLOCK`. - /// - `mq_maxmsg`: Maximum number of messages on the queue. - /// - `mq_msgsize`: Maximum message size in bytes. - /// - `mq_curmsgs`: Number of messages currently in the queue. pub fn new(mq_flags: mq_attr_member_t, mq_maxmsg: mq_attr_member_t, mq_msgsize: mq_attr_member_t, @@ -113,7 +97,6 @@ impl MqAttr { } } - /// The current flags, either `0` or `O_NONBLOCK`. pub const fn flags(&self) -> mq_attr_member_t { self.mq_attr.mq_flags } diff --git a/bash-5.1/vendor/nix/src/net/if_.rs b/bash-5.1/vendor/nix/src/net/if_.rs index 045efad9cc3fe5c5030a1ff4e9e01394e515b759..ebe8bcceeb3c77c82251a4c6e8db6f82278c235d 100644 --- a/bash-5.1/vendor/nix/src/net/if_.rs +++ b/bash-5.1/vendor/nix/src/net/if_.rs @@ -28,7 +28,6 @@ libc_bitflags!( IFF_BROADCAST; /// Internal debugging flag. (see /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) - #[cfg(not(target_os = "haiku"))] IFF_DEBUG; /// Interface is a loopback interface. (see /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) @@ -103,7 +102,8 @@ libc_bitflags!( target_os = "freebsd", target_os = "macos", target_os = "netbsd", - target_os = "openbsd"))] + target_os = "openbsd", + target_os = "osx"))] #[cfg_attr(docsrs, doc(cfg(all())))] IFF_SIMPLEX; /// Supports multicast. (see diff --git a/bash-5.1/vendor/nix/src/poll.rs b/bash-5.1/vendor/nix/src/poll.rs index 3004d24c37072fd0b9c8eacaaa306e9b5bbc0967..6d332b03500138416ba3c7cfdc01d48b0686bc75 100644 --- a/bash-5.1/vendor/nix/src/poll.rs +++ b/bash-5.1/vendor/nix/src/poll.rs @@ -151,24 +151,20 @@ feature! { /// `ppoll` behaves like `poll`, but let you specify what signals may interrupt it /// with the `sigmask` argument. If you want `ppoll` to block indefinitely, /// specify `None` as `timeout` (it is like `timeout = -1` for `poll`). -/// If `sigmask` is `None`, then no signal mask manipulation is performed, -/// so in that case `ppoll` differs from `poll` only in the precision of the -/// timeout argument. /// #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] pub fn ppoll( fds: &mut [PollFd], timeout: Option, - sigmask: Option + sigmask: crate::sys::signal::SigSet ) -> Result { let timeout = timeout.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); - let sigmask = sigmask.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); let res = unsafe { libc::ppoll(fds.as_mut_ptr() as *mut libc::pollfd, fds.len() as libc::nfds_t, timeout, - sigmask) + sigmask.as_ref()) }; Errno::result(res) } diff --git a/bash-5.1/vendor/nix/src/sched.rs b/bash-5.1/vendor/nix/src/sched.rs index e9a326e261a581fb0aa4bc72125a5b0d682a308b..e736f8d2493d1a94335cfebfa5026e9feff24289 100644 --- a/bash-5.1/vendor/nix/src/sched.rs +++ b/bash-5.1/vendor/nix/src/sched.rs @@ -233,8 +233,8 @@ mod sched_affinity { /// use nix::unistd::Pid; /// /// let mut cpu_set = CpuSet::new(); - /// cpu_set.set(0).unwrap(); - /// sched_setaffinity(Pid::from_raw(0), &cpu_set).unwrap(); + /// cpu_set.set(0); + /// sched_setaffinity(Pid::from_raw(0), &cpu_set); /// ``` pub fn sched_setaffinity(pid: Pid, cpuset: &CpuSet) -> Result<()> { let res = unsafe { diff --git a/bash-5.1/vendor/nix/src/sys/aio.rs b/bash-5.1/vendor/nix/src/sys/aio.rs index 6ff88469b98368b9ca3bd92c99557185b7f882a9..4780cdee334143a623d27e154ea3349f6944857e 100644 --- a/bash-5.1/vendor/nix/src/sys/aio.rs +++ b/bash-5.1/vendor/nix/src/sys/aio.rs @@ -2,12 +2,9 @@ //! POSIX Asynchronous I/O //! //! The POSIX AIO interface is used for asynchronous I/O on files and disk-like -//! devices. It supports [`read`](struct.AioRead.html#method.new), -//! [`write`](struct.AioWrite.html#method.new), -//! [`fsync`](struct.AioFsync.html#method.new), -//! [`readv`](struct.AioReadv.html#method.new), and -//! [`writev`](struct.AioWritev.html#method.new), operations, subject to -//! platform support. Completion +//! devices. It supports [`read`](struct.AioCb.html#method.read), +//! [`write`](struct.AioCb.html#method.write), and +//! [`fsync`](struct.AioCb.html#method.fsync) operations. Completion //! notifications can optionally be delivered via //! [signals](../signal/enum.SigevNotify.html#variant.SigevSignal), via the //! [`aio_suspend`](fn.aio_suspend.html) function, or via polling. Some @@ -20,30 +17,23 @@ //! that they will be executed atomically. //! //! Outstanding operations may be cancelled with -//! [`cancel`](trait.Aio.html#method.cancel) or +//! [`cancel`](struct.AioCb.html#method.cancel) or //! [`aio_cancel_all`](fn.aio_cancel_all.html), though the operating system may //! not support this for all filesystems and devices. -#[cfg(target_os = "freebsd")] -use std::io::{IoSlice, IoSliceMut}; -use std::{ - convert::TryFrom, - fmt::{self, Debug}, - marker::{PhantomData, PhantomPinned}, - mem, - os::unix::io::RawFd, - pin::Pin, - ptr, - thread, -}; -use libc::{c_void, off_t}; -use pin_utils::unsafe_pinned; - -use crate::{ - errno::Errno, - sys::{signal::*, time::TimeSpec}, - Result, -}; +use crate::Result; +use crate::errno::Errno; +use std::os::unix::io::RawFd; +use libc::{c_void, off_t, size_t}; +use std::fmt; +use std::fmt::Debug; +use std::marker::PhantomData; +use std::mem; +use std::pin::Pin; +use std::ptr::{null, null_mut}; +use crate::sys::signal::*; +use std::thread; +use crate::sys::time::TimeSpec; libc_enum! { /// Mode for `AioCb::fsync`. Controls whether only data or both data and @@ -62,7 +52,22 @@ libc_enum! { #[cfg_attr(docsrs, doc(cfg(all())))] O_DSYNC } - impl TryFrom +} + +libc_enum! { + /// When used with [`lio_listio`](fn.lio_listio.html), determines whether a + /// given `aiocb` should be used for a read operation, a write operation, or + /// ignored. Has no effect for any other aio functions. + #[repr(i32)] + #[non_exhaustive] + pub enum LioOpcode { + /// No operation + LIO_NOP, + /// Write data as if by a call to [`AioCb::write`] + LIO_WRITE, + /// Write data as if by a call to [`AioCb::read`] + LIO_READ, + } } libc_enum! { @@ -98,133 +103,354 @@ struct LibcAiocb(libc::aiocb); unsafe impl Send for LibcAiocb {} unsafe impl Sync for LibcAiocb {} -/// Base class for all AIO operations. Should only be used directly when -/// checking for completion. -// We could create some kind of AsPinnedMut trait, and implement it for all aio -// ops, allowing the crate's users to get pinned references to `AioCb`. That -// could save some code for things like polling methods. But IMHO it would -// provide polymorphism at the wrong level. Instead, the best place for -// polymorphism is at the level of `Futures`. -#[repr(C)] -struct AioCb { - aiocb: LibcAiocb, +/// AIO Control Block. +/// +/// The basic structure used by all aio functions. Each `AioCb` represents one +/// I/O request. +pub struct AioCb<'a> { + aiocb: LibcAiocb, + /// Tracks whether the buffer pointed to by `libc::aiocb.aio_buf` is mutable + mutable: bool, /// Could this `AioCb` potentially have any in-kernel state? - // It would be really nice to perform the in-progress check entirely at - // compile time. But I can't figure out how, because: - // * Future::poll takes a `Pin<&mut self>` rather than `self`, and - // * Rust's lack of an equivalent of C++'s Guaranteed Copy Elision means - // that there's no way to write an AioCb constructor that neither boxes - // the object itself, nor moves it during return. in_progress: bool, + _buffer: std::marker::PhantomData<&'a [u8]>, + _pin: std::marker::PhantomPinned } -impl AioCb { - pin_utils::unsafe_unpinned!(aiocb: LibcAiocb); - - fn aio_return(mut self: Pin<&mut Self>) -> Result { - self.in_progress = false; - unsafe { - let p: *mut libc::aiocb = &mut self.aiocb.0; - Errno::result(libc::aio_return(p)) - } - .map(|r| r as usize) +impl<'a> AioCb<'a> { + /// Returns the underlying file descriptor associated with the `AioCb` + pub fn fd(&self) -> RawFd { + self.aiocb.0.aio_fildes } - fn cancel(mut self: Pin<&mut Self>) -> Result { - let r = unsafe { - libc::aio_cancel(self.aiocb.0.aio_fildes, &mut self.aiocb.0) - }; - match r { - libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), - libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), - libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), - -1 => Err(Errno::last()), - _ => panic!("unknown aio_cancel return value"), - } + /// Constructs a new `AioCb` with no associated buffer. + /// + /// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio`. + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// + /// # Examples + /// + /// Create an `AioCb` from a raw file descriptor and use it for an + /// [`fsync`](#method.fsync) operation. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify::SigevNone; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_fd( f.as_raw_fd(), 0, SigevNone); + /// aiocb.fsync(AioFsyncMode::O_SYNC).expect("aio_fsync failed early"); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// aiocb.aio_return().expect("aio_fsync failed late"); + /// ``` + pub fn from_fd(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = 0; + a.0.aio_nbytes = 0; + a.0.aio_buf = null_mut(); + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) } - fn common_init(fd: RawFd, prio: i32, sigev_notify: SigevNotify) -> Self { - // Use mem::zeroed instead of explicitly zeroing each field, because the - // number and name of reserved fields is OS-dependent. On some OSes, - // some reserved fields are used the kernel for state, and must be - // explicitly zeroed when allocated. - let mut a = unsafe { mem::zeroed::() }; - a.aio_fildes = fd; - a.aio_reqprio = prio; - a.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + // Private helper + #[cfg(not(any(target_os = "ios", target_os = "macos")))] + fn from_mut_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb<'a> + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + AioCb { - aiocb: LibcAiocb(a), + aiocb: a, + mutable: true, in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned } } - fn error(self: Pin<&mut Self>) -> Result<()> { - let r = unsafe { libc::aio_error(&self.aiocb().0) }; - match r { - 0 => Ok(()), - num if num > 0 => Err(Errno::from_i32(num)), - -1 => Err(Errno::last()), - num => panic!("unknown aio_error return value {:?}", num), - } - } - - fn in_progress(&self) -> bool { - self.in_progress + /// Constructs a new `AioCb` from a mutable slice. + /// + /// The resulting `AioCb` will be suitable for both read and write + /// operations, but only if the borrow checker can guarantee that the slice + /// will outlive the `AioCb`. That will usually be the case if the `AioCb` + /// is stack-allocated. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: A memory buffer + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Examples + /// + /// Create an `AioCb` from a mutable slice and read into it. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const INITIAL: &[u8] = b"abcdef123456"; + /// const LEN: usize = 4; + /// let mut rbuf = vec![0; LEN]; + /// let mut f = tempfile().unwrap(); + /// f.write_all(INITIAL).unwrap(); + /// { + /// let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + /// 2, //offset + /// &mut rbuf, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.read().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, LEN); + /// } + /// assert_eq!(rbuf, b"cdef"); + /// ``` + pub fn from_mut_slice(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) } - fn set_in_progress(mut self: Pin<&mut Self>) { - self.as_mut().in_progress = true; + /// Constructs a new `AioCb` from a mutable raw pointer + /// + /// Unlike `from_mut_slice`, this method returns a structure suitable for + /// placement on the heap. It may be used for both reads and writes. Due + /// to its unsafety, this method is not recommended. It is most useful when + /// heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_mut_ptr(fd: RawFd, offs: off_t, + buf: *mut c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + a.0.aio_buf = buf; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned, + }) } - /// Update the notification settings for an existing AIO operation that has - /// not yet been submitted. - // Takes a normal reference rather than a pinned one because this method is - // normally called before the object needs to be pinned, that is, before - // it's been submitted to the kernel. - fn set_sigev_notify(&mut self, sigev_notify: SigevNotify) { - assert!( - !self.in_progress, - "Can't change notification settings for an in-progress operation" - ); - self.aiocb.0.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + /// Constructs a new `AioCb` from a raw pointer. + /// + /// Unlike `from_slice`, this method returns a structure suitable for + /// placement on the heap. Due to its unsafety, this method is not + /// recommended. It is most useful when heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_ptr(fd: RawFd, offs: off_t, + buf: *const c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + // casting a const ptr to a mutable ptr here is ok, because we set the + // AioCb's mutable field to false + a.0.aio_buf = buf as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) } -} -impl Debug for AioCb { - fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - fmt.debug_struct("AioCb") - .field("aiocb", &self.aiocb.0) - .field("in_progress", &self.in_progress) - .finish() - } -} + // Private helper + fn from_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + // casting an immutable buffer to a mutable pointer looks unsafe, + // but technically its only unsafe to dereference it, not to create + // it. + a.0.aio_buf = buf.as_ptr() as *mut c_void; + assert!(opcode != LioOpcode::LIO_READ, "Can't read into an immutable buffer"); + a.0.aio_lio_opcode = opcode as libc::c_int; -impl Drop for AioCb { - /// If the `AioCb` has no remaining state in the kernel, just drop it. - /// Otherwise, dropping constitutes a resource leak, which is an error - fn drop(&mut self) { - assert!( - thread::panicking() || !self.in_progress, - "Dropped an in-progress AioCb" - ); + AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + } } -} - -/// Methods common to all AIO operations -pub trait Aio { - /// The return type of [`Aio::aio_return`]. - type Output; - /// Retrieve return status of an asynchronous operation. + /// Like [`AioCb::from_mut_slice`], but works on constant slices rather than + /// mutable slices. /// - /// Should only be called once for each operation, after [`Aio::error`] - /// indicates that it has completed. The result is the same as for the - /// synchronous `read(2)`, `write(2)`, of `fsync(2)` functions. + /// An `AioCb` created this way cannot be used with `read`, and its + /// `LioOpcode` cannot be set to `LIO_READ`. This method is useful when + /// writing a const buffer with `AioCb::write`, since `from_mut_slice` can't + /// work with const buffers. /// - /// # References + /// # Examples /// - /// [aio_return](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html) - fn aio_return(self: Pin<&mut Self>) -> Result; + /// Construct an `AioCb` from a slice and use it for writing. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + /// ``` + // Note: another solution to the problem of writing const buffers would be + // to genericize AioCb for both &mut [u8] and &[u8] buffers. AioCb::read + // could take the former and AioCb::write could take the latter. However, + // then lio_listio wouldn't work, because that function needs a slice of + // AioCb, and they must all be of the same type. + pub fn from_slice(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin> + { + Box::pin(AioCb::from_slice_unpinned(fd, offs, buf, prio, sigev_notify, + opcode)) + } + + fn common_init(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> LibcAiocb { + // Use mem::zeroed instead of explicitly zeroing each field, because the + // number and name of reserved fields is OS-dependent. On some OSes, + // some reserved fields are used the kernel for state, and must be + // explicitly zeroed when allocated. + let mut a = unsafe { mem::zeroed::()}; + a.aio_fildes = fd; + a.aio_reqprio = prio; + a.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + LibcAiocb(a) + } + + /// Update the notification settings for an existing `aiocb` + pub fn set_sigev_notify(self: &mut Pin>, + sigev_notify: SigevNotify) + { + // Safe because we don't move any of the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aiocb.0.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + } /// Cancels an outstanding AIO request. /// @@ -251,26 +477,51 @@ pub trait Aio { /// # use tempfile::tempfile; /// let wbuf = b"CDEF"; /// let mut f = tempfile().unwrap(); - /// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), /// 2, //offset /// &wbuf[..], /// 0, //priority - /// SigevNotify::SigevNone)); - /// aiocb.as_mut().submit().unwrap(); - /// let cs = aiocb.as_mut().cancel().unwrap(); + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// let cs = aiocb.cancel().unwrap(); /// if cs == AioCancelStat::AioNotCanceled { - /// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { /// thread::sleep(time::Duration::from_millis(10)); /// } /// } /// // Must call `aio_return`, but ignore the result - /// let _ = aiocb.as_mut().aio_return(); + /// let _ = aiocb.aio_return(); /// ``` /// /// # References /// /// [aio_cancel](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) - fn cancel(self: Pin<&mut Self>) -> Result; + pub fn cancel(self: &mut Pin>) -> Result { + let r = unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + libc::aio_cancel(selfp.aiocb.0.aio_fildes, &mut selfp.aiocb.0) + }; + match r { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") + } + } + + fn error_unpinned(&mut self) -> Result<()> { + let r = unsafe { + libc::aio_error(&mut self.aiocb.0 as *mut libc::aiocb) + }; + match r { + 0 => Ok(()), + num if num > 0 => Err(Errno::from_i32(num)), + -1 => Err(Errno::last()), + num => panic!("unknown aio_error return value {:?}", num) + } + } /// Retrieve error status of an asynchronous operation. /// @@ -292,222 +543,155 @@ pub trait Aio { /// # use tempfile::tempfile; /// const WBUF: &[u8] = b"abcdef123456"; /// let mut f = tempfile().unwrap(); - /// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), /// 2, //offset /// WBUF, /// 0, //priority - /// SigevNotify::SigevNone)); - /// aiocb.as_mut().submit().unwrap(); - /// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { /// thread::sleep(time::Duration::from_millis(10)); /// } - /// assert_eq!(aiocb.as_mut().aio_return().unwrap(), WBUF.len()); + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); /// ``` /// /// # References /// /// [aio_error](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html) - fn error(self: Pin<&mut Self>) -> Result<()>; - - /// Returns the underlying file descriptor associated with the operation. - fn fd(&self) -> RawFd; + pub fn error(self: &mut Pin>) -> Result<()> { + // Safe because error_unpinned doesn't move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.error_unpinned() + } - /// Does this operation currently have any in-kernel state? - /// - /// Dropping an operation that does have in-kernel state constitutes a - /// resource leak. + /// An asynchronous version of `fsync(2)`. /// - /// # Examples + /// # References /// - /// ``` - /// # use nix::errno::Errno; - /// # use nix::Error; - /// # use nix::sys::aio::*; - /// # use nix::sys::signal::SigevNotify::SigevNone; - /// # use std::{thread, time}; - /// # use std::os::unix::io::AsRawFd; - /// # use tempfile::tempfile; - /// let f = tempfile().unwrap(); - /// let mut aiof = Box::pin(AioFsync::new(f.as_raw_fd(), AioFsyncMode::O_SYNC, - /// 0, SigevNone)); - /// assert!(!aiof.as_mut().in_progress()); - /// aiof.as_mut().submit().expect("aio_fsync failed early"); - /// assert!(aiof.as_mut().in_progress()); - /// while (aiof.as_mut().error() == Err(Errno::EINPROGRESS)) { - /// thread::sleep(time::Duration::from_millis(10)); - /// } - /// aiof.as_mut().aio_return().expect("aio_fsync failed late"); - /// assert!(!aiof.as_mut().in_progress()); - /// ``` - fn in_progress(&self) -> bool; - - /// Returns the priority of the `AioCb` - fn priority(&self) -> i32; - - /// Update the notification settings for an existing AIO operation that has - /// not yet been submitted. - fn set_sigev_notify(&mut self, sev: SigevNotify); - - /// Returns the `SigEvent` that will be used for notification. - fn sigevent(&self) -> SigEvent; + /// [aio_fsync](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html) + pub fn fsync(self: &mut Pin>, mode: AioFsyncMode) -> Result<()> { + // Safe because we don't move the libc::aiocb + unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + libc::aio_fsync(mode as libc::c_int, p) + }).map(|_| { + selfp.in_progress = true; + }) + } + } - /// Actually start the I/O operation. + /// Returns the `aiocb`'s `LioOpcode` field /// - /// After calling this method and until [`Aio::aio_return`] returns `Ok`, - /// the structure may not be moved in memory. - fn submit(self: Pin<&mut Self>) -> Result<()>; -} - -macro_rules! aio_methods { - () => { - fn cancel(self: Pin<&mut Self>) -> Result { - self.aiocb().cancel() + /// If the value cannot be represented as an `LioOpcode`, returns `None` + /// instead. + pub fn lio_opcode(&self) -> Option { + match self.aiocb.0.aio_lio_opcode { + libc::LIO_READ => Some(LioOpcode::LIO_READ), + libc::LIO_WRITE => Some(LioOpcode::LIO_WRITE), + libc::LIO_NOP => Some(LioOpcode::LIO_NOP), + _ => None } + } - fn error(self: Pin<&mut Self>) -> Result<()> { - self.aiocb().error() - } + /// Returns the requested length of the aio operation in bytes + /// + /// This method returns the *requested* length of the operation. To get the + /// number of bytes actually read or written by a completed operation, use + /// `aio_return` instead. + pub fn nbytes(&self) -> usize { + self.aiocb.0.aio_nbytes + } - fn fd(&self) -> RawFd { - self.aiocb.aiocb.0.aio_fildes - } + /// Returns the file offset stored in the `AioCb` + pub fn offset(&self) -> off_t { + self.aiocb.0.aio_offset + } - fn in_progress(&self) -> bool { - self.aiocb.in_progress() - } + /// Returns the priority of the `AioCb` + pub fn priority(&self) -> libc::c_int { + self.aiocb.0.aio_reqprio + } - fn priority(&self) -> i32 { - self.aiocb.aiocb.0.aio_reqprio - } + /// Asynchronously reads from a file descriptor into a buffer + /// + /// # References + /// + /// [aio_read](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html) + pub fn read(self: &mut Pin>) -> Result<()> { + assert!(self.mutable, "Can't read into an immutable buffer"); + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe { libc::aio_read(p) } + }).map(|_| { + selfp.in_progress = true; + }) + } - fn set_sigev_notify(&mut self, sev: SigevNotify) { - self.aiocb.set_sigev_notify(sev) - } + /// Returns the `SigEvent` stored in the `AioCb` + pub fn sigevent(&self) -> SigEvent { + SigEvent::from(&self.aiocb.0.aio_sigevent) + } - fn sigevent(&self) -> SigEvent { - SigEvent::from(&self.aiocb.aiocb.0.aio_sigevent) + fn aio_return_unpinned(&mut self) -> Result { + unsafe { + let p: *mut libc::aiocb = &mut self.aiocb.0; + self.in_progress = false; + Errno::result(libc::aio_return(p)) } - }; - ($func:ident) => { - aio_methods!(); + } - fn aio_return(self: Pin<&mut Self>) -> Result<::Output> { - self.aiocb().aio_return() - } + /// Retrieve return status of an asynchronous operation. + /// + /// Should only be called once for each `AioCb`, after `AioCb::error` + /// indicates that it has completed. The result is the same as for the + /// synchronous `read(2)`, `write(2)`, of `fsync(2)` functions. + /// + /// # References + /// + /// [aio_return](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html) + // Note: this should be just `return`, but that's a reserved word + pub fn aio_return(self: &mut Pin>) -> Result { + // Safe because aio_return_unpinned does not move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aio_return_unpinned() + } - fn submit(mut self: Pin<&mut Self>) -> Result<()> { - let p: *mut libc::aiocb = &mut self.as_mut().aiocb().aiocb.0; - Errno::result({ unsafe { libc::$func(p) } }).map(|_| { - self.aiocb().set_in_progress(); - }) - } - }; -} - -/// An asynchronous version of `fsync(2)`. -/// -/// # References -/// -/// [aio_fsync](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html) -/// # Examples -/// -/// ``` -/// # use nix::errno::Errno; -/// # use nix::Error; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify::SigevNone; -/// # use std::{thread, time}; -/// # use std::os::unix::io::AsRawFd; -/// # use tempfile::tempfile; -/// let f = tempfile().unwrap(); -/// let mut aiof = Box::pin(AioFsync::new(f.as_raw_fd(), AioFsyncMode::O_SYNC, -/// 0, SigevNone)); -/// aiof.as_mut().submit().expect("aio_fsync failed early"); -/// while (aiof.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// aiof.as_mut().aio_return().expect("aio_fsync failed late"); -/// ``` -#[derive(Debug)] -#[repr(transparent)] -pub struct AioFsync { - aiocb: AioCb, - _pin: PhantomPinned, -} - -impl AioFsync { - unsafe_pinned!(aiocb: AioCb); - - /// Returns the operation's fsync mode: data and metadata or data only? - pub fn mode(&self) -> AioFsyncMode { - AioFsyncMode::try_from(self.aiocb.aiocb.0.aio_lio_opcode).unwrap() - } - - /// Create a new `AioFsync`. + /// Asynchronously writes from a buffer to a file descriptor /// - /// # Arguments + /// # References /// - /// * `fd`: File descriptor to sync. - /// * `mode`: Whether to sync file metadata too, or just data. - /// * `prio`: If POSIX Prioritized IO is supported, then the - /// operation will be prioritized at the process's - /// priority level minus `prio`. - /// * `sigev_notify`: Determines how you will be notified of event - /// completion. - pub fn new( - fd: RawFd, - mode: AioFsyncMode, - prio: i32, - sigev_notify: SigevNotify, - ) -> Self { - let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); - // To save some memory, store mode in an unused field of the AioCb. - // True it isn't very much memory, but downstream creates will likely - // create an enum containing this and other AioCb variants and pack - // those enums into data structures like Vec, so it adds up. - aiocb.aiocb.0.aio_lio_opcode = mode as libc::c_int; - AioFsync { - aiocb, - _pin: PhantomPinned, - } - } -} - -impl Aio for AioFsync { - type Output = (); - - aio_methods!(); - - fn aio_return(self: Pin<&mut Self>) -> Result<()> { - self.aiocb().aio_return().map(drop) - } - - fn submit(mut self: Pin<&mut Self>) -> Result<()> { - let aiocb = &mut self.as_mut().aiocb().aiocb.0; - let mode = mem::replace(&mut aiocb.aio_lio_opcode, 0); - let p: *mut libc::aiocb = aiocb; - Errno::result(unsafe { libc::aio_fsync(mode, p) }).map(|_| { - self.aiocb().set_in_progress(); + /// [aio_write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html) + pub fn write(self: &mut Pin>) -> Result<()> { + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe{ libc::aio_write(p) } + }).map(|_| { + selfp.in_progress = true; }) } } -// AioFsync does not need AsMut, since it can't be used with lio_listio - -impl AsRef for AioFsync { - fn as_ref(&self) -> &libc::aiocb { - &self.aiocb.aiocb.0 - } -} - -/// Asynchronously reads from a file descriptor into a buffer -/// -/// # References -/// -/// [aio_read](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html) +/// Cancels outstanding AIO requests for a given file descriptor. /// /// # Examples /// +/// Issue an aio operation, then cancel all outstanding operations on that file +/// descriptor. /// /// ``` /// # use nix::errno::Errno; @@ -518,727 +702,428 @@ impl AsRef for AioFsync { /// # use std::io::Write; /// # use std::os::unix::io::AsRawFd; /// # use tempfile::tempfile; -/// const INITIAL: &[u8] = b"abcdef123456"; -/// const LEN: usize = 4; -/// let mut rbuf = vec![0; LEN]; +/// let wbuf = b"CDEF"; /// let mut f = tempfile().unwrap(); -/// f.write_all(INITIAL).unwrap(); -/// { -/// let mut aior = Box::pin( -/// AioRead::new( -/// f.as_raw_fd(), -/// 2, //offset -/// &mut rbuf, -/// 0, //priority -/// SigevNotify::SigevNone -/// ) -/// ); -/// aior.as_mut().submit().unwrap(); -/// while (aior.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// &wbuf[..], +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// let cs = aio_cancel_all(f.as_raw_fd()).unwrap(); +/// if cs == AioCancelStat::AioNotCanceled { +/// while (aiocb.error() == Err(Errno::EINPROGRESS)) { /// thread::sleep(time::Duration::from_millis(10)); /// } -/// assert_eq!(aior.as_mut().aio_return().unwrap(), LEN); /// } -/// assert_eq!(rbuf, b"cdef"); +/// // Must call `aio_return`, but ignore the result +/// let _ = aiocb.aio_return(); /// ``` -#[derive(Debug)] -#[repr(transparent)] -pub struct AioRead<'a> { - aiocb: AioCb, - _data: PhantomData<&'a [u8]>, - _pin: PhantomPinned, -} - -impl<'a> AioRead<'a> { - unsafe_pinned!(aiocb: AioCb); - - /// Returns the requested length of the aio operation in bytes - /// - /// This method returns the *requested* length of the operation. To get the - /// number of bytes actually read or written by a completed operation, use - /// `aio_return` instead. - pub fn nbytes(&self) -> usize { - self.aiocb.aiocb.0.aio_nbytes - } - - /// Create a new `AioRead`, placing the data in a mutable slice. - /// - /// # Arguments - /// - /// * `fd`: File descriptor to read from - /// * `offs`: File offset - /// * `buf`: A memory buffer. It must outlive the `AioRead`. - /// * `prio`: If POSIX Prioritized IO is supported, then the - /// operation will be prioritized at the process's - /// priority level minus `prio` - /// * `sigev_notify`: Determines how you will be notified of event - /// completion. - pub fn new( - fd: RawFd, - offs: off_t, - buf: &'a mut [u8], - prio: i32, - sigev_notify: SigevNotify, - ) -> Self { - let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); - aiocb.aiocb.0.aio_nbytes = buf.len(); - aiocb.aiocb.0.aio_buf = buf.as_mut_ptr() as *mut c_void; - aiocb.aiocb.0.aio_lio_opcode = libc::LIO_READ; - aiocb.aiocb.0.aio_offset = offs; - AioRead { - aiocb, - _data: PhantomData, - _pin: PhantomPinned, - } - } - - /// Returns the file offset of the operation. - pub fn offset(&self) -> off_t { - self.aiocb.aiocb.0.aio_offset - } -} - -impl<'a> Aio for AioRead<'a> { - type Output = usize; - - aio_methods!(aio_read); -} - -impl<'a> AsMut for AioRead<'a> { - fn as_mut(&mut self) -> &mut libc::aiocb { - &mut self.aiocb.aiocb.0 - } -} - -impl<'a> AsRef for AioRead<'a> { - fn as_ref(&self) -> &libc::aiocb { - &self.aiocb.aiocb.0 +/// +/// # References +/// +/// [`aio_cancel`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) +pub fn aio_cancel_all(fd: RawFd) -> Result { + match unsafe { libc::aio_cancel(fd, null_mut()) } { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") } } -/// Asynchronously reads from a file descriptor into a scatter/gather list of buffers. -/// -/// # References +/// Suspends the calling process until at least one of the specified `AioCb`s +/// has completed, a signal is delivered, or the timeout has passed. /// -/// [aio_readv](https://www.freebsd.org/cgi/man.cgi?query=aio_readv) +/// If `timeout` is `None`, `aio_suspend` will block indefinitely. /// /// # Examples /// +/// Use `aio_suspend` to block until an aio operation completes. /// -#[cfg_attr(fbsd14, doc = " ```")] -#[cfg_attr(not(fbsd14), doc = " ```no_run")] -/// # use nix::errno::Errno; -/// # use nix::Error; +/// ``` /// # use nix::sys::aio::*; /// # use nix::sys::signal::SigevNotify; -/// # use std::{thread, time}; -/// # use std::io::{IoSliceMut, Write}; /// # use std::os::unix::io::AsRawFd; /// # use tempfile::tempfile; -/// const INITIAL: &[u8] = b"abcdef123456"; -/// let mut rbuf0 = vec![0; 4]; -/// let mut rbuf1 = vec![0; 2]; -/// let expected_len = rbuf0.len() + rbuf1.len(); -/// let mut rbufs = [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; +/// const WBUF: &[u8] = b"abcdef123456"; /// let mut f = tempfile().unwrap(); -/// f.write_all(INITIAL).unwrap(); -/// { -/// let mut aior = Box::pin( -/// AioReadv::new( -/// f.as_raw_fd(), -/// 2, //offset -/// &mut rbufs, -/// 0, //priority -/// SigevNotify::SigevNone -/// ) -/// ); -/// aior.as_mut().submit().unwrap(); -/// while (aior.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// assert_eq!(aior.as_mut().aio_return().unwrap(), expected_len); -/// } -/// assert_eq!(rbuf0, b"cdef"); -/// assert_eq!(rbuf1, b"12"); +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// WBUF, +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// aio_suspend(&[aiocb.as_ref()], None).expect("aio_suspend failed"); +/// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); /// ``` -#[cfg(target_os = "freebsd")] -#[derive(Debug)] -#[repr(transparent)] -pub struct AioReadv<'a> { - aiocb: AioCb, - _data: PhantomData<&'a [&'a [u8]]>, - _pin: PhantomPinned, +/// # References +/// +/// [`aio_suspend`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html) +pub fn aio_suspend(list: &[Pin<&AioCb>], timeout: Option) -> Result<()> { + let plist = list as *const [Pin<&AioCb>] as *const [*const libc::aiocb]; + let p = plist as *const *const libc::aiocb; + let timep = match timeout { + None => null::(), + Some(x) => x.as_ref() as *const libc::timespec + }; + Errno::result(unsafe { + libc::aio_suspend(p, list.len() as i32, timep) + }).map(drop) } -#[cfg(target_os = "freebsd")] -impl<'a> AioReadv<'a> { - unsafe_pinned!(aiocb: AioCb); - - /// Returns the number of buffers the operation will read into. - pub fn iovlen(&self) -> usize { - self.aiocb.aiocb.0.aio_nbytes - } - - /// Create a new `AioReadv`, placing the data in a list of mutable slices. - /// - /// # Arguments - /// - /// * `fd`: File descriptor to read from - /// * `offs`: File offset - /// * `bufs`: A scatter/gather list of memory buffers. They must - /// outlive the `AioReadv`. - /// * `prio`: If POSIX Prioritized IO is supported, then the - /// operation will be prioritized at the process's - /// priority level minus `prio` - /// * `sigev_notify`: Determines how you will be notified of event - /// completion. - pub fn new( - fd: RawFd, - offs: off_t, - bufs: &mut [IoSliceMut<'a>], - prio: i32, - sigev_notify: SigevNotify, - ) -> Self { - let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); - // In vectored mode, aio_nbytes stores the length of the iovec array, - // not the byte count. - aiocb.aiocb.0.aio_nbytes = bufs.len(); - aiocb.aiocb.0.aio_buf = bufs.as_mut_ptr() as *mut c_void; - aiocb.aiocb.0.aio_lio_opcode = libc::LIO_READV; - aiocb.aiocb.0.aio_offset = offs; - AioReadv { - aiocb, - _data: PhantomData, - _pin: PhantomPinned, - } +impl<'a> Debug for AioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("AioCb") + .field("aiocb", &self.aiocb.0) + .field("mutable", &self.mutable) + .field("in_progress", &self.in_progress) + .finish() } +} - /// Returns the file offset of the operation. - pub fn offset(&self) -> off_t { - self.aiocb.aiocb.0.aio_offset +impl<'a> Drop for AioCb<'a> { + /// If the `AioCb` has no remaining state in the kernel, just drop it. + /// Otherwise, dropping constitutes a resource leak, which is an error + fn drop(&mut self) { + assert!(thread::panicking() || !self.in_progress, + "Dropped an in-progress AioCb"); } } -#[cfg(target_os = "freebsd")] -impl<'a> Aio for AioReadv<'a> { - type Output = usize; +/// LIO Control Block. +/// +/// The basic structure used to issue multiple AIO operations simultaneously. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub struct LioCb<'a> { + /// A collection of [`AioCb`]s. All of these will be issued simultaneously + /// by the [`listio`] method. + /// + /// [`AioCb`]: struct.AioCb.html + /// [`listio`]: #method.listio + // Their locations in memory must be fixed once they are passed to the + // kernel. So this field must be non-public so the user can't swap. + aiocbs: Box<[AioCb<'a>]>, - aio_methods!(aio_readv); + /// The actual list passed to `libc::lio_listio`. + /// + /// It must live for as long as any of the operations are still being + /// processesed, because the aio subsystem uses its address as a unique + /// identifier. + list: Vec<*mut libc::aiocb>, + + /// A partial set of results. This field will get populated by + /// `listio_resubmit` when an `LioCb` is resubmitted after an error + results: Vec>> } -#[cfg(target_os = "freebsd")] -impl<'a> AsMut for AioReadv<'a> { - fn as_mut(&mut self) -> &mut libc::aiocb { - &mut self.aiocb.aiocb.0 +/// LioCb can't automatically impl Send and Sync just because of the raw +/// pointers in list. But that's stupid. There's no reason that raw pointers +/// should automatically be non-Send +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Send for LioCb<'a> {} +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Sync for LioCb<'a> {} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> LioCb<'a> { + /// Are no [`AioCb`]s contained? + pub fn is_empty(&self) -> bool { + self.aiocbs.is_empty() } -} -#[cfg(target_os = "freebsd")] -impl<'a> AsRef for AioReadv<'a> { - fn as_ref(&self) -> &libc::aiocb { - &self.aiocb.aiocb.0 + /// Return the number of individual [`AioCb`]s contained. + pub fn len(&self) -> usize { + self.aiocbs.len() } -} - -/// Asynchronously writes from a buffer to a file descriptor -/// -/// # References -/// -/// [aio_write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html) -/// -/// # Examples -/// -/// ``` -/// # use nix::errno::Errno; -/// # use nix::Error; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use std::{thread, time}; -/// # use std::os::unix::io::AsRawFd; -/// # use tempfile::tempfile; -/// const WBUF: &[u8] = b"abcdef123456"; -/// let mut f = tempfile().unwrap(); -/// let mut aiow = Box::pin( -/// AioWrite::new( -/// f.as_raw_fd(), -/// 2, //offset -/// WBUF, -/// 0, //priority -/// SigevNotify::SigevNone -/// ) -/// ); -/// aiow.as_mut().submit().unwrap(); -/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); -/// ``` -#[derive(Debug)] -#[repr(transparent)] -pub struct AioWrite<'a> { - aiocb: AioCb, - _data: PhantomData<&'a [u8]>, - _pin: PhantomPinned, -} -impl<'a> AioWrite<'a> { - unsafe_pinned!(aiocb: AioCb); - - /// Returns the requested length of the aio operation in bytes + /// Submits multiple asynchronous I/O requests with a single system call. /// - /// This method returns the *requested* length of the operation. To get the - /// number of bytes actually read or written by a completed operation, use - /// `aio_return` instead. - pub fn nbytes(&self) -> usize { - self.aiocb.aiocb.0.aio_nbytes + /// They are not guaranteed to complete atomically, and the order in which + /// the requests are carried out is not specified. Reads, writes, and + /// fsyncs may be freely mixed. + /// + /// This function is useful for reducing the context-switch overhead of + /// submitting many AIO operations. It can also be used with + /// `LioMode::LIO_WAIT` to block on the result of several independent + /// operations. Used that way, it is often useful in programs that + /// otherwise make little use of AIO. + /// + /// # Examples + /// + /// Use `listio` to submit an aio operation and wait for its completion. In + /// this case, there is no need to use [`aio_suspend`] to wait or + /// [`AioCb::error`] to poll. + /// + /// ``` + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// liocb.listio(LioMode::LIO_WAIT, + /// SigevNotify::SigevNone).unwrap(); + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`aio_suspend`]: fn.aio_suspend.html + /// [`AioCb::error`]: struct.AioCb.html#method.error + pub fn listio(&mut self, mode: LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + for a in &mut self.aiocbs.iter_mut() { + a.in_progress = true; + self.list.push(a as *mut AioCb<'a> + as *mut libc::aiocb); + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) } - /// Construct a new `AioWrite`. + /// Resubmits any incomplete operations with [`lio_listio`]. /// - /// # Arguments + /// Sometimes, due to system resource limitations, an `lio_listio` call will + /// return `EIO`, or `EAGAIN`. Or, if a signal is received, it may return + /// `EINTR`. In any of these cases, only a subset of its constituent + /// operations will actually have been initiated. `listio_resubmit` will + /// resubmit any operations that are still uninitiated. /// - /// * `fd`: File descriptor to write to - /// * `offs`: File offset - /// * `buf`: A memory buffer. It must outlive the `AioWrite`. - /// * `prio`: If POSIX Prioritized IO is supported, then the - /// operation will be prioritized at the process's - /// priority level minus `prio` - /// * `sigev_notify`: Determines how you will be notified of event - /// completion. - pub fn new( - fd: RawFd, - offs: off_t, - buf: &'a [u8], - prio: i32, - sigev_notify: SigevNotify, - ) -> Self { - let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); - aiocb.aiocb.0.aio_nbytes = buf.len(); - // casting an immutable buffer to a mutable pointer looks unsafe, - // but technically its only unsafe to dereference it, not to create - // it. Type Safety guarantees that we'll never pass aiocb to - // aio_read or aio_readv. - aiocb.aiocb.0.aio_buf = buf.as_ptr() as *mut c_void; - aiocb.aiocb.0.aio_lio_opcode = libc::LIO_WRITE; - aiocb.aiocb.0.aio_offset = offs; - AioWrite { - aiocb, - _data: PhantomData, - _pin: PhantomPinned, + /// After calling `listio_resubmit`, results should be collected by + /// [`LioCb::aio_return`]. + /// + /// # Examples + /// ```no_run + /// # use nix::Error; + /// # use nix::errno::Errno; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use std::{thread, time}; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// let mut err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// while err == Err(Errno::EIO) || + /// err == Err(Errno::EAGAIN) { + /// thread::sleep(time::Duration::from_millis(10)); + /// err = liocb.listio_resubmit(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// } + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`lio_listio`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html + /// [`LioCb::aio_return`]: struct.LioCb.html#method.aio_return + // Note: the addresses of any EINPROGRESS or EOK aiocbs _must_ not be + // changed by this method, because the kernel relies on their addresses + // being stable. + // Note: aiocbs that are Ok(()) must be finalized by aio_return, or else the + // sigev_notify will immediately refire. + pub fn listio_resubmit(&mut self, mode:LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + + while self.results.len() < self.aiocbs.len() { + self.results.push(None); } - } - /// Returns the file offset of the operation. - pub fn offset(&self) -> off_t { - self.aiocb.aiocb.0.aio_offset + for (i, a) in self.aiocbs.iter_mut().enumerate() { + if self.results[i].is_some() { + // Already collected final status for this operation + continue; + } + match a.error_unpinned() { + Ok(()) => { + // aiocb is complete; collect its status and don't resubmit + self.results[i] = Some(a.aio_return_unpinned()); + }, + Err(Errno::EAGAIN) => { + self.list.push(a as *mut AioCb<'a> as *mut libc::aiocb); + }, + Err(Errno::EINPROGRESS) => { + // aiocb is was successfully queued; no need to do anything + }, + Err(Errno::EINVAL) => panic!( + "AioCb was never submitted, or already finalized"), + _ => unreachable!() + } + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) } -} - -impl<'a> Aio for AioWrite<'a> { - type Output = usize; - aio_methods!(aio_write); -} + /// Collect final status for an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::aio_return`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::aio_return`]: struct.AioCb.html#method.aio_return + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn aio_return(&mut self, i: usize) -> Result { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].aio_return_unpinned() + } else { + self.results[i].unwrap() + } + } -impl<'a> AsMut for AioWrite<'a> { - fn as_mut(&mut self) -> &mut libc::aiocb { - &mut self.aiocb.aiocb.0 + /// Retrieve error status of an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::error`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::error`]: struct.AioCb.html#method.error + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn error(&mut self, i: usize) -> Result<()> { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].error_unpinned() + } else { + Ok(()) + } } } -impl<'a> AsRef for AioWrite<'a> { - fn as_ref(&self) -> &libc::aiocb { - &self.aiocb.aiocb.0 +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +impl<'a> Debug for LioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("LioCb") + .field("aiocbs", &self.aiocbs) + .finish() } } -/// Asynchronously writes from a scatter/gather list of buffers to a file descriptor. -/// -/// # References -/// -/// [aio_writev](https://www.freebsd.org/cgi/man.cgi?query=aio_writev) -/// -/// # Examples -/// -#[cfg_attr(fbsd14, doc = " ```")] -#[cfg_attr(not(fbsd14), doc = " ```no_run")] -/// # use nix::errno::Errno; -/// # use nix::Error; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use std::{thread, time}; -/// # use std::io::IoSlice; -/// # use std::os::unix::io::AsRawFd; -/// # use tempfile::tempfile; -/// const wbuf0: &[u8] = b"abcdef"; -/// const wbuf1: &[u8] = b"123456"; -/// let len = wbuf0.len() + wbuf1.len(); -/// let wbufs = [IoSlice::new(wbuf0), IoSlice::new(wbuf1)]; -/// let mut f = tempfile().unwrap(); -/// let mut aiow = Box::pin( -/// AioWritev::new( -/// f.as_raw_fd(), -/// 2, //offset -/// &wbufs, -/// 0, //priority -/// SigevNotify::SigevNone -/// ) -/// ); -/// aiow.as_mut().submit().unwrap(); -/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// assert_eq!(aiow.as_mut().aio_return().unwrap(), len); -/// ``` -#[cfg(target_os = "freebsd")] +/// Used to construct `LioCb` +// This must be a separate class from LioCb due to pinning constraints. LioCb +// must use a boxed slice of AioCbs so they will have stable storage, but +// LioCbBuilder must use a Vec to make construction possible when the final size +// is unknown. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] #[derive(Debug)] -#[repr(transparent)] -pub struct AioWritev<'a> { - aiocb: AioCb, - _data: PhantomData<&'a [&'a [u8]]>, - _pin: PhantomPinned, +pub struct LioCbBuilder<'a> { + /// A collection of [`AioCb`]s. + /// + /// [`AioCb`]: struct.AioCb.html + pub aiocbs: Vec>, } -#[cfg(target_os = "freebsd")] -impl<'a> AioWritev<'a> { - unsafe_pinned!(aiocb: AioCb); - - /// Returns the number of buffers the operation will read into. - pub fn iovlen(&self) -> usize { - self.aiocb.aiocb.0.aio_nbytes +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> LioCbBuilder<'a> { + /// Initialize an empty `LioCb` + pub fn with_capacity(capacity: usize) -> LioCbBuilder<'a> { + LioCbBuilder { + aiocbs: Vec::with_capacity(capacity), + } } - /// Construct a new `AioWritev`. + /// Add a new operation on an immutable slice to the [`LioCb`] under + /// construction. /// - /// # Arguments + /// Arguments are the same as for [`AioCb::from_slice`] /// - /// * `fd`: File descriptor to write to - /// * `offs`: File offset - /// * `bufs`: A scatter/gather list of memory buffers. They must - /// outlive the `AioWritev`. - /// * `prio`: If POSIX Prioritized IO is supported, then the - /// operation will be prioritized at the process's - /// priority level minus `prio` - /// * `sigev_notify`: Determines how you will be notified of event - /// completion. - pub fn new( - fd: RawFd, - offs: off_t, - bufs: &[IoSlice<'a>], - prio: i32, - sigev_notify: SigevNotify, - ) -> Self { - let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); - // In vectored mode, aio_nbytes stores the length of the iovec array, - // not the byte count. - aiocb.aiocb.0.aio_nbytes = bufs.len(); - // casting an immutable buffer to a mutable pointer looks unsafe, - // but technically its only unsafe to dereference it, not to create - // it. Type Safety guarantees that we'll never pass aiocb to - // aio_read or aio_readv. - aiocb.aiocb.0.aio_buf = bufs.as_ptr() as *mut c_void; - aiocb.aiocb.0.aio_lio_opcode = libc::LIO_WRITEV; - aiocb.aiocb.0.aio_offset = offs; - AioWritev { - aiocb, - _data: PhantomData, - _pin: PhantomPinned, - } - } - - /// Returns the file offset of the operation. - pub fn offset(&self) -> off_t { - self.aiocb.aiocb.0.aio_offset + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_slice`]: struct.AioCb.html#method.from_slice + #[must_use] + pub fn emplace_slice(mut self, fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Self + { + self.aiocbs.push(AioCb::from_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self } -} - -#[cfg(target_os = "freebsd")] -impl<'a> Aio for AioWritev<'a> { - type Output = usize; - aio_methods!(aio_writev); -} - -#[cfg(target_os = "freebsd")] -impl<'a> AsMut for AioWritev<'a> { - fn as_mut(&mut self) -> &mut libc::aiocb { - &mut self.aiocb.aiocb.0 - } -} - -#[cfg(target_os = "freebsd")] -impl<'a> AsRef for AioWritev<'a> { - fn as_ref(&self) -> &libc::aiocb { - &self.aiocb.aiocb.0 + /// Add a new operation on a mutable slice to the [`LioCb`] under + /// construction. + /// + /// Arguments are the same as for [`AioCb::from_mut_slice`] + /// + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_mut_slice`]: struct.AioCb.html#method.from_mut_slice + #[must_use] + pub fn emplace_mut_slice(mut self, fd: RawFd, offs: off_t, + buf: &'a mut [u8], prio: libc::c_int, + sigev_notify: SigevNotify, opcode: LioOpcode) + -> Self + { + self.aiocbs.push(AioCb::from_mut_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self } -} -/// Cancels outstanding AIO requests for a given file descriptor. -/// -/// # Examples -/// -/// Issue an aio operation, then cancel all outstanding operations on that file -/// descriptor. -/// -/// ``` -/// # use nix::errno::Errno; -/// # use nix::Error; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use std::{thread, time}; -/// # use std::io::Write; -/// # use std::os::unix::io::AsRawFd; -/// # use tempfile::tempfile; -/// let wbuf = b"CDEF"; -/// let mut f = tempfile().unwrap(); -/// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), -/// 2, //offset -/// &wbuf[..], -/// 0, //priority -/// SigevNotify::SigevNone)); -/// aiocb.as_mut().submit().unwrap(); -/// let cs = aio_cancel_all(f.as_raw_fd()).unwrap(); -/// if cs == AioCancelStat::AioNotCanceled { -/// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// } -/// // Must call `aio_return`, but ignore the result -/// let _ = aiocb.as_mut().aio_return(); -/// ``` -/// -/// # References -/// -/// [`aio_cancel`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) -pub fn aio_cancel_all(fd: RawFd) -> Result { - match unsafe { libc::aio_cancel(fd, ptr::null_mut()) } { - libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), - libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), - libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), - -1 => Err(Errno::last()), - _ => panic!("unknown aio_cancel return value"), + /// Finalize this [`LioCb`]. + /// + /// Afterwards it will be possible to issue the operations with + /// [`LioCb::listio`]. Conversely, it will no longer be possible to add new + /// operations with [`LioCbBuilder::emplace_slice`] or + /// [`LioCbBuilder::emplace_mut_slice`]. + /// + /// [`LioCb::listio`]: struct.LioCb.html#method.listio + /// [`LioCb::from_mut_slice`]: struct.LioCb.html#method.from_mut_slice + /// [`LioCb::from_slice`]: struct.LioCb.html#method.from_slice + pub fn finish(self) -> LioCb<'a> { + let len = self.aiocbs.len(); + LioCb { + aiocbs: self.aiocbs.into(), + list: Vec::with_capacity(len), + results: Vec::with_capacity(len) + } } } -/// Suspends the calling process until at least one of the specified operations -/// have completed, a signal is delivered, or the timeout has passed. -/// -/// If `timeout` is `None`, `aio_suspend` will block indefinitely. -/// -/// # Examples -/// -/// Use `aio_suspend` to block until an aio operation completes. -/// -/// ``` -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use std::os::unix::io::AsRawFd; -/// # use tempfile::tempfile; -/// const WBUF: &[u8] = b"abcdef123456"; -/// let mut f = tempfile().unwrap(); -/// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), -/// 2, //offset -/// WBUF, -/// 0, //priority -/// SigevNotify::SigevNone)); -/// aiocb.as_mut().submit().unwrap(); -/// aio_suspend(&[&*aiocb], None).expect("aio_suspend failed"); -/// assert_eq!(aiocb.as_mut().aio_return().unwrap() as usize, WBUF.len()); -/// ``` -/// # References -/// -/// [`aio_suspend`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html) -pub fn aio_suspend( - list: &[&dyn AsRef], - timeout: Option, -) -> Result<()> { - let p = list as *const [&dyn AsRef] - as *const [*const libc::aiocb] - as *const *const libc::aiocb; - let timep = match timeout { - None => ptr::null::(), - Some(x) => x.as_ref() as *const libc::timespec, - }; - Errno::result(unsafe { libc::aio_suspend(p, list.len() as i32, timep) }) - .map(drop) -} - -/// Submits multiple asynchronous I/O requests with a single system call. -/// -/// They are not guaranteed to complete atomically, and the order in which the -/// requests are carried out is not specified. Reads, and writes may be freely -/// mixed. -/// -/// # Examples -/// -/// Use `lio_listio` to submit an aio operation and wait for its completion. In -/// this case, there is no need to use aio_suspend to wait or `error` to poll. -/// This mode is useful for otherwise-synchronous programs that want to execute -/// a handful of I/O operations in parallel. -/// ``` -/// # use std::os::unix::io::AsRawFd; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use tempfile::tempfile; -/// const WBUF: &[u8] = b"abcdef123456"; -/// let mut f = tempfile().unwrap(); -/// let mut aiow = Box::pin(AioWrite::new( -/// f.as_raw_fd(), -/// 2, // offset -/// WBUF, -/// 0, // priority -/// SigevNotify::SigevNone -/// )); -/// lio_listio(LioMode::LIO_WAIT, &mut[aiow.as_mut()], SigevNotify::SigevNone) -/// .unwrap(); -/// // At this point, we are guaranteed that aiow is complete. -/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); -/// ``` -/// -/// Use `lio_listio` to submit multiple asynchronous operations with a single -/// syscall, but receive notification individually. This is an efficient -/// technique for reducing overall context-switch overhead, especially when -/// combined with kqueue. -/// ``` -/// # use std::os::unix::io::AsRawFd; -/// # use std::thread; -/// # use std::time; -/// # use nix::errno::Errno; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::SigevNotify; -/// # use tempfile::tempfile; -/// const WBUF: &[u8] = b"abcdef123456"; -/// let mut f = tempfile().unwrap(); -/// let mut aiow = Box::pin(AioWrite::new( -/// f.as_raw_fd(), -/// 2, // offset -/// WBUF, -/// 0, // priority -/// SigevNotify::SigevNone -/// )); -/// lio_listio(LioMode::LIO_NOWAIT, &mut[aiow.as_mut()], SigevNotify::SigevNone) -/// .unwrap(); -/// // We must wait for the completion of each individual operation -/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); -/// ``` -/// -/// Use `lio_listio` to submit multiple operations, and receive notification -/// only when all of them are complete. This can be useful when there is some -/// logical relationship between the operations. But beware! Errors or system -/// resource limitations may cause `lio_listio` to return `EIO`, `EAGAIN`, or -/// `EINTR`, in which case some but not all operations may have been submitted. -/// In that case, you must check the status of each individual operation, and -/// possibly resubmit some. -/// ``` -/// # use libc::c_int; -/// # use std::os::unix::io::AsRawFd; -/// # use std::sync::atomic::{AtomicBool, Ordering}; -/// # use std::thread; -/// # use std::time; -/// # use lazy_static::lazy_static; -/// # use nix::errno::Errno; -/// # use nix::sys::aio::*; -/// # use nix::sys::signal::*; -/// # use tempfile::tempfile; -/// lazy_static! { -/// pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); -/// } -/// -/// extern fn sigfunc(_: c_int) { -/// SIGNALED.store(true, Ordering::Relaxed); -/// } -/// let sa = SigAction::new(SigHandler::Handler(sigfunc), -/// SaFlags::SA_RESETHAND, -/// SigSet::empty()); -/// SIGNALED.store(false, Ordering::Relaxed); -/// unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); -/// -/// const WBUF: &[u8] = b"abcdef123456"; -/// let mut f = tempfile().unwrap(); -/// let mut aiow = Box::pin(AioWrite::new( -/// f.as_raw_fd(), -/// 2, // offset -/// WBUF, -/// 0, // priority -/// SigevNotify::SigevNone -/// )); -/// let sev = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, si_value: 0 }; -/// lio_listio(LioMode::LIO_NOWAIT, &mut[aiow.as_mut()], sev).unwrap(); -/// while !SIGNALED.load(Ordering::Relaxed) { -/// thread::sleep(time::Duration::from_millis(10)); -/// } -/// // At this point, since `lio_listio` returned success and delivered its -/// // notification, we know that all operations are complete. -/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); -/// ``` -pub fn lio_listio( - mode: LioMode, - list: &mut [Pin<&mut dyn AsMut>], - sigev_notify: SigevNotify, -) -> Result<()> { - let p = list as *mut [Pin<&mut dyn AsMut>] - as *mut [*mut libc::aiocb] - as *mut *mut libc::aiocb; - let sigev = SigEvent::new(sigev_notify); - let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; - Errno::result(unsafe { - libc::lio_listio(mode as i32, p, list.len() as i32, sigevp) - }) - .map(drop) -} - +#[cfg(not(any(target_os = "ios", target_os = "macos")))] #[cfg(test)] mod t { use super::*; - /// aio_suspend relies on casting Rust Aio* struct pointers to libc::aiocb - /// pointers. This test ensures that such casts are valid. + // It's important that `LioCb` be `UnPin`. The tokio-file crate relies on + // it. #[test] - fn casting() { - let sev = SigevNotify::SigevNone; - let aiof = AioFsync::new(666, AioFsyncMode::O_SYNC, 0, sev); - assert_eq!( - aiof.as_ref() as *const libc::aiocb, - &aiof as *const AioFsync as *const libc::aiocb - ); - - let mut rbuf = []; - let aior = AioRead::new(666, 0, &mut rbuf, 0, sev); - assert_eq!( - aior.as_ref() as *const libc::aiocb, - &aior as *const AioRead as *const libc::aiocb - ); - - let wbuf = []; - let aiow = AioWrite::new(666, 0, &wbuf, 0, sev); - assert_eq!( - aiow.as_ref() as *const libc::aiocb, - &aiow as *const AioWrite as *const libc::aiocb - ); - } - - #[cfg(target_os = "freebsd")] - #[test] - fn casting_vectored() { - let sev = SigevNotify::SigevNone; - - let mut rbuf = []; - let mut rbufs = [IoSliceMut::new(&mut rbuf)]; - let aiorv = AioReadv::new(666, 0, &mut rbufs[..], 0, sev); - assert_eq!( - aiorv.as_ref() as *const libc::aiocb, - &aiorv as *const AioReadv as *const libc::aiocb - ); + fn liocb_is_unpin() { + use assert_impl::assert_impl; - let wbuf = []; - let wbufs = [IoSlice::new(&wbuf)]; - let aiowv = AioWritev::new(666, 0, &wbufs, 0, sev); - assert_eq!( - aiowv.as_ref() as *const libc::aiocb, - &aiowv as *const AioWritev as *const libc::aiocb - ); + assert_impl!(Unpin: LioCb); } } diff --git a/bash-5.1/vendor/nix/src/sys/event.rs b/bash-5.1/vendor/nix/src/sys/event.rs index 0d0d23a48feb192a791dc47d47b517523c5fc041..9262accf2c9433546de5f9270df089e241124144 100644 --- a/bash-5.1/vendor/nix/src/sys/event.rs +++ b/bash-5.1/vendor/nix/src/sys/event.rs @@ -7,7 +7,6 @@ use libc::{timespec, time_t, c_int, c_long, intptr_t, uintptr_t}; #[cfg(target_os = "netbsd")] use libc::{timespec, time_t, c_long, intptr_t, uintptr_t, size_t}; use std::convert::TryInto; -use std::mem; use std::os::unix::io::RawFd; use std::ptr; @@ -22,8 +21,13 @@ pub struct KEvent { target_os = "ios", target_os = "macos", target_os = "openbsd"))] type type_of_udata = *mut libc::c_void; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos"))] +type type_of_data = intptr_t; #[cfg(any(target_os = "netbsd"))] type type_of_udata = intptr_t; +#[cfg(any(target_os = "netbsd", target_os = "openbsd"))] +type type_of_data = i64; #[cfg(target_os = "netbsd")] type type_of_event_filter = u32; @@ -213,7 +217,6 @@ unsafe impl Send for KEvent { } impl KEvent { - #[allow(clippy::needless_update)] // Not needless on all platforms. pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag, fflags:FilterFlag, data: intptr_t, udata: intptr_t) -> KEvent { KEvent { kevent: libc::kevent { @@ -221,10 +224,8 @@ impl KEvent { filter: filter as type_of_event_filter, flags: flags.bits(), fflags: fflags.bits(), - // data can be either i64 or intptr_t, depending on platform - data: data as _, - udata: udata as type_of_udata, - .. unsafe { mem::zeroed() } + data: data as type_of_data, + udata: udata as type_of_udata } } } @@ -327,7 +328,7 @@ fn test_struct_kevent() { assert_eq!(libc::EVFILT_READ, filter); assert_eq!(libc::EV_ONESHOT | libc::EV_ADD, actual.flags().bits()); assert_eq!(libc::NOTE_CHILD | libc::NOTE_EXIT, actual.fflags().bits()); - assert_eq!(0x1337, actual.data()); + assert_eq!(0x1337, actual.data() as type_of_data); assert_eq!(udata as type_of_udata, actual.udata() as type_of_udata); assert_eq!(mem::size_of::(), mem::size_of::()); } diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs b/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs index 307994cb969f9ba6ae3bfd12aa2e636f542b0c61..4ce4d332a82696b40de169accd77618f3178de98 100644 --- a/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs +++ b/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs @@ -21,7 +21,7 @@ mod consts { #[allow(overflowing_literals)] pub const IN: ioctl_num_type = 0x8000_0000; #[doc(hidden)] - pub const INOUT: ioctl_num_type = IN | OUT; + pub const INOUT: ioctl_num_type = IN|OUT; #[doc(hidden)] pub const IOCPARM_MASK: ioctl_num_type = 0x1fff; } @@ -31,14 +31,9 @@ pub use self::consts::*; #[macro_export] #[doc(hidden)] macro_rules! ioc { - ($inout:expr, $group:expr, $num:expr, $len:expr) => { - $inout - | (($len as $crate::sys::ioctl::ioctl_num_type - & $crate::sys::ioctl::IOCPARM_MASK) - << 16) - | (($group as $crate::sys::ioctl::ioctl_num_type) << 8) - | ($num as $crate::sys::ioctl::ioctl_num_type) - }; + ($inout:expr, $group:expr, $num:expr, $len:expr) => ( + $inout | (($len as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::IOCPARM_MASK) << 16) | (($group as $crate::sys::ioctl::ioctl_num_type) << 8) | ($num as $crate::sys::ioctl::ioctl_num_type) + ) } /// Generate an ioctl request code for a command that passes no data. @@ -58,9 +53,7 @@ macro_rules! ioc { /// ``` #[macro_export(local_inner_macros)] macro_rules! request_code_none { - ($g:expr, $n:expr) => { - ioc!($crate::sys::ioctl::VOID, $g, $n, 0) - }; + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, 0)) } /// Generate an ioctl request code for a command that passes an integer @@ -71,14 +64,7 @@ macro_rules! request_code_none { /// with is "bad" and you cannot use `ioctl_write_int!()` directly. #[macro_export(local_inner_macros)] macro_rules! request_code_write_int { - ($g:expr, $n:expr) => { - ioc!( - $crate::sys::ioctl::VOID, - $g, - $n, - ::std::mem::size_of::<$crate::libc::c_int>() - ) - }; + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, ::std::mem::size_of::<$crate::libc::c_int>())) } /// Generate an ioctl request code for a command that reads. @@ -93,9 +79,7 @@ macro_rules! request_code_write_int { /// writing. #[macro_export(local_inner_macros)] macro_rules! request_code_read { - ($g:expr, $n:expr, $len:expr) => { - ioc!($crate::sys::ioctl::OUT, $g, $n, $len) - }; + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::OUT, $g, $n, $len)) } /// Generate an ioctl request code for a command that writes. @@ -110,9 +94,7 @@ macro_rules! request_code_read { /// reading. #[macro_export(local_inner_macros)] macro_rules! request_code_write { - ($g:expr, $n:expr, $len:expr) => { - ioc!($crate::sys::ioctl::IN, $g, $n, $len) - }; + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::IN, $g, $n, $len)) } /// Generate an ioctl request code for a command that reads and writes. @@ -123,7 +105,5 @@ macro_rules! request_code_write { /// with is "bad" and you cannot use `ioctl_readwrite!()` directly. #[macro_export(local_inner_macros)] macro_rules! request_code_readwrite { - ($g:expr, $n:expr, $len:expr) => { - ioc!($crate::sys::ioctl::INOUT, $g, $n, $len) - }; + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::INOUT, $g, $n, $len)) } diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs b/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs index 0c0a2090538f8356e00855e7b0784fe50354bc0b..08cd0c33b4f22cb5c562a0f9b4c59043793edabd 100644 --- a/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs +++ b/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs @@ -14,13 +14,7 @@ pub const NRBITS: ioctl_num_type = 8; #[doc(hidden)] pub const TYPEBITS: ioctl_num_type = 8; -#[cfg(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64", - target_arch = "sparc64" -))] +#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64", target_arch = "sparc64"))] mod consts { #[doc(hidden)] pub const NONE: u8 = 1; @@ -35,15 +29,13 @@ mod consts { } // "Generic" ioctl protocol -#[cfg(any( - target_arch = "x86", - target_arch = "arm", - target_arch = "s390x", - target_arch = "x86_64", - target_arch = "aarch64", - target_arch = "riscv32", - target_arch = "riscv64" -))] +#[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "s390x", + target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv32", + target_arch = "riscv64"))] mod consts { #[doc(hidden)] pub const NONE: u8 = 0; @@ -81,20 +73,11 @@ pub const DIRMASK: ioctl_num_type = (1 << DIRBITS) - 1; #[macro_export] #[doc(hidden)] macro_rules! ioc { - ($dir:expr, $ty:expr, $nr:expr, $sz:expr) => { - (($dir as $crate::sys::ioctl::ioctl_num_type - & $crate::sys::ioctl::DIRMASK) - << $crate::sys::ioctl::DIRSHIFT) - | (($ty as $crate::sys::ioctl::ioctl_num_type - & $crate::sys::ioctl::TYPEMASK) - << $crate::sys::ioctl::TYPESHIFT) - | (($nr as $crate::sys::ioctl::ioctl_num_type - & $crate::sys::ioctl::NRMASK) - << $crate::sys::ioctl::NRSHIFT) - | (($sz as $crate::sys::ioctl::ioctl_num_type - & $crate::sys::ioctl::SIZEMASK) - << $crate::sys::ioctl::SIZESHIFT) - }; + ($dir:expr, $ty:expr, $nr:expr, $sz:expr) => ( + (($dir as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::DIRMASK) << $crate::sys::ioctl::DIRSHIFT) | + (($ty as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::TYPEMASK) << $crate::sys::ioctl::TYPESHIFT) | + (($nr as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::NRMASK) << $crate::sys::ioctl::NRSHIFT) | + (($sz as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::SIZEMASK) << $crate::sys::ioctl::SIZESHIFT)) } /// Generate an ioctl request code for a command that passes no data. @@ -114,9 +97,7 @@ macro_rules! ioc { /// ``` #[macro_export(local_inner_macros)] macro_rules! request_code_none { - ($ty:expr, $nr:expr) => { - ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0) - }; + ($ty:expr, $nr:expr) => (ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0)) } /// Generate an ioctl request code for a command that reads. @@ -131,9 +112,7 @@ macro_rules! request_code_none { /// writing. #[macro_export(local_inner_macros)] macro_rules! request_code_read { - ($ty:expr, $nr:expr, $sz:expr) => { - ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz) - }; + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz)) } /// Generate an ioctl request code for a command that writes. @@ -148,9 +127,7 @@ macro_rules! request_code_read { /// reading. #[macro_export(local_inner_macros)] macro_rules! request_code_write { - ($ty:expr, $nr:expr, $sz:expr) => { - ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz) - }; + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz)) } /// Generate an ioctl request code for a command that reads and writes. @@ -161,12 +138,5 @@ macro_rules! request_code_write { /// with is "bad" and you cannot use `ioctl_readwrite!()` directly. #[macro_export(local_inner_macros)] macro_rules! request_code_readwrite { - ($ty:expr, $nr:expr, $sz:expr) => { - ioc!( - $crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, - $ty, - $nr, - $sz - ) - }; + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, $ty, $nr, $sz)) } diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs b/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs index 98d6b5c99d481f21a835a99b2886ba9b797ea878..203b7d06f31f116f68bc3757bd6b4ae3ae07195e 100644 --- a/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs +++ b/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs @@ -227,45 +227,37 @@ use cfg_if::cfg_if; #[macro_use] mod linux; -#[cfg(any( - target_os = "android", - target_os = "linux", - target_os = "redox" -))] +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] pub use self::linux::*; -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "haiku", - target_os = "openbsd" -))] +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] #[macro_use] mod bsd; -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "haiku", - target_os = "openbsd" -))] +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] pub use self::bsd::*; /// Convert raw ioctl return value to a Nix result #[macro_export] #[doc(hidden)] macro_rules! convert_ioctl_res { - ($w:expr) => {{ - $crate::errno::Errno::result($w) - }}; + ($w:expr) => ( + { + $crate::errno::Errno::result($w) + } + ); } /// Generates a wrapper function for an ioctl that passes no data to the kernel. @@ -497,7 +489,7 @@ macro_rules! ioctl_write_ptr_bad { ) } -cfg_if! { +cfg_if!{ if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] { /// Generates a wrapper function for a ioctl that writes an integer to the kernel. /// diff --git a/bash-5.1/vendor/nix/src/sys/mman.rs b/bash-5.1/vendor/nix/src/sys/mman.rs index 700e231c620dae487c4c1fa4b7cb2b09aca341ed..a7469a1792325be88ebfcfd4c83cb5f213d8f5a3 100644 --- a/bash-5.1/vendor/nix/src/sys/mman.rs +++ b/bash-5.1/vendor/nix/src/sys/mman.rs @@ -351,7 +351,6 @@ libc_bitflags!{ } } -#[cfg(not(target_os = "haiku"))] libc_bitflags!{ /// Flags for [`mlockall`]. pub struct MlockAllFlags: c_int { @@ -394,7 +393,6 @@ pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> { /// Locked pages never move to the swap area. For more information, see [`mlockall(2)`]. /// /// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html -#[cfg(not(target_os = "haiku"))] pub fn mlockall(flags: MlockAllFlags) -> Result<()> { unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop) } @@ -404,7 +402,6 @@ pub fn mlockall(flags: MlockAllFlags) -> Result<()> { /// For more information, see [`munlockall(2)`]. /// /// [`munlockall(2)`]: https://man7.org/linux/man-pages/man2/munlockall.2.html -#[cfg(not(target_os = "haiku"))] pub fn munlockall() -> Result<()> { unsafe { Errno::result(libc::munlockall()) }.map(drop) } diff --git a/bash-5.1/vendor/nix/src/sys/mod.rs b/bash-5.1/vendor/nix/src/sys/mod.rs index 979d623b8987bc6013cee976a0dfdd8977a7d710..e5639f20abaa2ce249fa7fae1f0dd71f7cbfda58 100644 --- a/bash-5.1/vendor/nix/src/sys/mod.rs +++ b/bash-5.1/vendor/nix/src/sys/mod.rs @@ -1,12 +1,10 @@ //! Mostly platform-specific functionality -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - all(target_os = "linux", not(target_env = "uclibc")), - target_os = "macos", - target_os = "netbsd" -))] +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd"))] feature! { #![feature = "aio"] pub mod aio; @@ -33,24 +31,22 @@ feature! { pub mod eventfd; } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "redox", - target_os = "macos", - target_os = "netbsd", - target_os = "illumos", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] #[cfg(feature = "ioctl")] #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] #[macro_use] pub mod ioctl; -#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(target_os = "linux")] feature! { #![feature = "fs"] pub mod memfd; @@ -73,15 +69,13 @@ feature! { pub mod pthread; } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] feature! { #![feature = "ptrace"] #[allow(missing_docs)] @@ -100,12 +94,7 @@ feature! { pub mod reboot; } -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "illumos", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] feature! { #![feature = "resource"] pub mod resource; @@ -117,14 +106,12 @@ feature! { pub mod select; } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "macos" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] feature! { #![feature = "zerocopy"] pub mod sendfile; @@ -152,14 +139,13 @@ feature! { pub mod stat; } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "macos", - target_os = "openbsd" +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd" ))] feature! { #![feature = "fs"] diff --git a/bash-5.1/vendor/nix/src/sys/personality.rs b/bash-5.1/vendor/nix/src/sys/personality.rs index 9e285ae6e0c3b2162f5e8acb020e93cd123079e8..2af668782345818ae548704c39e27d13da9e3965 100644 --- a/bash-5.1/vendor/nix/src/sys/personality.rs +++ b/bash-5.1/vendor/nix/src/sys/personality.rs @@ -86,7 +86,7 @@ pub fn get() -> Result { /// # use nix::sys::personality::{self, Persona}; /// let mut pers = personality::get().unwrap(); /// assert!(!pers.contains(Persona::ADDR_NO_RANDOMIZE)); -/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE).unwrap(); +/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE); /// ``` pub fn set(persona: Persona) -> Result { let res = unsafe { diff --git a/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs b/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs index 1d9b241c1f870b6e4342036250a87874a7d31735..24152d7d5a861e9810e1106bf2a76334f6702710 100644 --- a/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs +++ b/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs @@ -481,24 +481,3 @@ pub unsafe fn write( { ptrace_other(Request::PTRACE_POKEDATA, pid, addr, data).map(drop) } - -/// Reads a word from a user area at `offset`. -/// The user struct definition can be found in `/usr/include/sys/user.h`. -pub fn read_user(pid: Pid, offset: AddressType) -> Result { - ptrace_peek(Request::PTRACE_PEEKUSER, pid, offset, ptr::null_mut()) -} - -/// Writes a word to a user area at `offset`. -/// The user struct definition can be found in `/usr/include/sys/user.h`. -/// -/// # Safety -/// -/// The `data` argument is passed directly to `ptrace(2)`. Read that man page -/// for guidance. -pub unsafe fn write_user( - pid: Pid, - offset: AddressType, - data: *mut c_void) -> Result<()> -{ - ptrace_other(Request::PTRACE_POKEUSER, pid, offset, data).map(drop) -} diff --git a/bash-5.1/vendor/nix/src/sys/quota.rs b/bash-5.1/vendor/nix/src/sys/quota.rs index f3b4c02dee965dd8186805d2e531b7da64d65619..6e34e38d2b720f151c24cefd84daba506123281e 100644 --- a/bash-5.1/vendor/nix/src/sys/quota.rs +++ b/bash-5.1/vendor/nix/src/sys/quota.rs @@ -6,11 +6,11 @@ //! //! ```rust,no_run //! # use nix::sys::quota::{Dqblk, quotactl_on, quotactl_set, QuotaFmt, QuotaType, QuotaValidFlags}; -//! quotactl_on(QuotaType::USRQUOTA, "/dev/sda1", QuotaFmt::QFMT_VFS_V1, "aquota.user").unwrap(); +//! quotactl_on(QuotaType::USRQUOTA, "/dev/sda1", QuotaFmt::QFMT_VFS_V1, "aquota.user"); //! let mut dqblk: Dqblk = Default::default(); //! dqblk.set_blocks_hard_limit(10000); //! dqblk.set_blocks_soft_limit(8000); -//! quotactl_set(QuotaType::USRQUOTA, "/dev/sda1", 50, &dqblk, QuotaValidFlags::QIF_BLIMITS).unwrap(); +//! quotactl_set(QuotaType::USRQUOTA, "/dev/sda1", 50, &dqblk, QuotaValidFlags::QIF_BLIMITS); //! ``` use std::default::Default; use std::{mem, ptr}; diff --git a/bash-5.1/vendor/nix/src/sys/resource.rs b/bash-5.1/vendor/nix/src/sys/resource.rs index e9a11d95d48c34d0f8116e95e4407f71a890c09e..76ceaf5b9053ab8c87f1ed88bcc6628583043fa8 100644 --- a/bash-5.1/vendor/nix/src/sys/resource.rs +++ b/bash-5.1/vendor/nix/src/sys/resource.rs @@ -1,9 +1,7 @@ //! Configure the process resource limits. use cfg_if::cfg_if; -use libc::{c_int, c_long, rusage}; use crate::errno::Errno; -use crate::sys::time::TimeVal; use crate::Result; pub use libc::rlim_t; use std::mem; @@ -21,7 +19,7 @@ cfg_if! { target_os = "dragonfly", all(target_os = "linux", not(target_env = "gnu")) ))]{ - use libc::rlimit; + use libc::{c_int, rlimit}; } } @@ -244,7 +242,11 @@ pub fn getrlimit(resource: Resource) -> Result<(rlim_t, rlim_t)> { /// [`Resource`]: enum.Resource.html /// /// Note: `setrlimit` provides a safe wrapper to libc's `setrlimit`. -pub fn setrlimit(resource: Resource, soft_limit: rlim_t, hard_limit: rlim_t) -> Result<()> { +pub fn setrlimit( + resource: Resource, + soft_limit: rlim_t, + hard_limit: rlim_t, +) -> Result<()> { let new_rlim = rlimit { rlim_cur: soft_limit, rlim_max: hard_limit, @@ -259,179 +261,3 @@ pub fn setrlimit(resource: Resource, soft_limit: rlim_t, hard_limit: rlim_t) -> Errno::result(res).map(drop) } - -libc_enum! { - /// Whose resource usage should be returned by [`getrusage`]. - #[repr(i32)] - #[non_exhaustive] - pub enum UsageWho { - /// Resource usage for the current process. - RUSAGE_SELF, - - /// Resource usage for all the children that have terminated and been waited for. - RUSAGE_CHILDREN, - - #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] - #[cfg_attr(docsrs, doc(cfg(all())))] - /// Resource usage for the calling thread. - RUSAGE_THREAD, - } -} - -/// Output of `getrusage` with information about resource usage. Some of the fields -/// may be unused in some platforms, and will be always zeroed out. See their manuals -/// for details. -#[repr(transparent)] -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] -pub struct Usage(rusage); - -impl AsRef for Usage { - fn as_ref(&self) -> &rusage { - &self.0 - } -} - -impl AsMut for Usage { - fn as_mut(&mut self) -> &mut rusage { - &mut self.0 - } -} - -impl Usage { - /// Total amount of time spent executing in user mode. - pub fn user_time(&self) -> TimeVal { - TimeVal::from(self.0.ru_utime) - } - - /// Total amount of time spent executing in kernel mode. - pub fn system_time(&self) -> TimeVal { - TimeVal::from(self.0.ru_stime) - } - - /// The resident set size at its peak, in kilobytes. - pub fn max_rss(&self) -> c_long { - self.0.ru_maxrss - } - - /// Integral value expressed in kilobytes times ticks of execution indicating - /// the amount of text memory shared with other processes. - pub fn shared_integral(&self) -> c_long { - self.0.ru_ixrss - } - - /// Integral value expressed in kilobytes times ticks of execution indicating - /// the amount of unshared memory used by data. - pub fn unshared_data_integral(&self) -> c_long { - self.0.ru_idrss - } - - /// Integral value expressed in kilobytes times ticks of execution indicating - /// the amount of unshared memory used for stack space. - pub fn unshared_stack_integral(&self) -> c_long { - self.0.ru_isrss - } - - /// Number of page faults that were served without resorting to I/O, with pages - /// that have been allocated previously by the kernel. - pub fn minor_page_faults(&self) -> c_long { - self.0.ru_minflt - } - - /// Number of page faults that were served through I/O (i.e. swap). - pub fn major_page_faults(&self) -> c_long { - self.0.ru_majflt - } - - /// Number of times all of the memory was fully swapped out. - pub fn full_swaps(&self) -> c_long { - self.0.ru_nswap - } - - /// Number of times a read was done from a block device. - pub fn block_reads(&self) -> c_long { - self.0.ru_inblock - } - - /// Number of times a write was done to a block device. - pub fn block_writes(&self) -> c_long { - self.0.ru_oublock - } - - /// Number of IPC messages sent. - pub fn ipc_sends(&self) -> c_long { - self.0.ru_msgsnd - } - - /// Number of IPC messages received. - pub fn ipc_receives(&self) -> c_long { - self.0.ru_msgrcv - } - - /// Number of signals received. - pub fn signals(&self) -> c_long { - self.0.ru_nsignals - } - - /// Number of times a context switch was voluntarily invoked. - pub fn voluntary_context_switches(&self) -> c_long { - self.0.ru_nvcsw - } - - /// Number of times a context switch was imposed by the kernel (usually due to - /// time slice expiring or preemption by a higher priority process). - pub fn involuntary_context_switches(&self) -> c_long { - self.0.ru_nivcsw - } -} - -/// Get usage information for a process, its children or the current thread -/// -/// Real time information can be obtained for either the current process or (in some -/// systems) thread, but information about children processes is only provided for -/// those that have terminated and been waited for (see [`super::wait::wait`]). -/// -/// Some information may be missing depending on the platform, and the way information -/// is provided for children may also vary. Check the manuals for details. -/// -/// # References -/// -/// * [getrusage(2)](https://pubs.opengroup.org/onlinepubs/009696699/functions/getrusage.html) -/// * [Linux](https://man7.org/linux/man-pages/man2/getrusage.2.html) -/// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=getrusage) -/// * [NetBSD](https://man.netbsd.org/getrusage.2) -/// * [MacOS](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html) -/// -/// [`UsageWho`]: enum.UsageWho.html -/// -/// Note: `getrusage` provides a safe wrapper to libc's [`libc::getrusage`]. -pub fn getrusage(who: UsageWho) -> Result { - unsafe { - let mut rusage = mem::MaybeUninit::::uninit(); - let res = libc::getrusage(who as c_int, rusage.as_mut_ptr()); - Errno::result(res).map(|_| Usage(rusage.assume_init())) - } -} - -#[cfg(test)] -mod test { - use super::{getrusage, UsageWho}; - - #[test] - pub fn test_self_cpu_time() { - // Make sure some CPU time is used. - let mut numbers: Vec = (1..1_000_000).collect(); - numbers.iter_mut().for_each(|item| *item *= 2); - - // FIXME: this is here to help ensure the compiler does not optimize the whole - // thing away. Replace the assert with test::black_box once stabilized. - assert_eq!(numbers[100..200].iter().sum::(), 30_100); - - let usage = getrusage(UsageWho::RUSAGE_SELF).expect("Failed to call getrusage for SELF"); - let rusage = usage.as_ref(); - - let user = usage.user_time(); - assert!(user.tv_sec() > 0 || user.tv_usec() > 0); - assert_eq!(user.tv_sec(), rusage.ru_utime.tv_sec); - assert_eq!(user.tv_usec(), rusage.ru_utime.tv_usec); - } -} diff --git a/bash-5.1/vendor/nix/src/sys/signal.rs b/bash-5.1/vendor/nix/src/sys/signal.rs index 0da9c74ad6eea9087b02f71756deabcc688e9f39..f982b4e79bba4b57613d53a686a32dbf2529c7fa 100644 --- a/bash-5.1/vendor/nix/src/sys/signal.rs +++ b/bash-5.1/vendor/nix/src/sys/signal.rs @@ -3,22 +3,22 @@ //! Operating system signals. -use crate::errno::Errno; use crate::{Error, Result}; -use cfg_if::cfg_if; -use std::fmt; +use crate::errno::Errno; use std::mem; +use std::fmt; +use std::str::FromStr; #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] use std::os::unix::io::RawFd; use std::ptr; -use std::str::FromStr; +use cfg_if::cfg_if; #[cfg(not(any(target_os = "openbsd", target_os = "redox")))] #[cfg(any(feature = "aio", feature = "signal"))] pub use self::sigevent::*; #[cfg(any(feature = "aio", feature = "process", feature = "signal"))] -libc_enum! { +libc_enum!{ /// Types of operating system signals // Currently there is only one definition of c_int in libc, as well as only one // type for signal constants. @@ -89,8 +89,6 @@ libc_enum! { /// Window size changes SIGWINCH, /// Input/output possible signal - #[cfg(not(target_os = "haiku"))] - #[cfg_attr(docsrs, doc(cfg(all())))] SIGIO, #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] @@ -101,13 +99,13 @@ libc_enum! { SIGSYS, #[cfg(not(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux", - target_os = "redox", target_os = "haiku")))] + target_os = "redox")))] #[cfg_attr(docsrs, doc(cfg(all())))] /// Emulator trap SIGEMT, #[cfg(not(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux", - target_os = "redox", target_os = "haiku")))] + target_os = "redox")))] #[cfg_attr(docsrs, doc(cfg(all())))] /// Information request SIGINFO, @@ -135,19 +133,10 @@ impl FromStr for Signal { "SIGPIPE" => Signal::SIGPIPE, "SIGALRM" => Signal::SIGALRM, "SIGTERM" => Signal::SIGTERM, - #[cfg(all( - any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux" - ), - not(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "sparc64" - )) - ))] + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] "SIGSTKFLT" => Signal::SIGSTKFLT, "SIGCHLD" => Signal::SIGCHLD, "SIGCONT" => Signal::SIGCONT, @@ -161,33 +150,18 @@ impl FromStr for Signal { "SIGVTALRM" => Signal::SIGVTALRM, "SIGPROF" => Signal::SIGPROF, "SIGWINCH" => Signal::SIGWINCH, - #[cfg(not(target_os = "haiku"))] "SIGIO" => Signal::SIGIO, - #[cfg(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux" - ))] + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] "SIGPWR" => Signal::SIGPWR, "SIGSYS" => Signal::SIGSYS, - #[cfg(not(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux", - target_os = "redox", - target_os = "haiku" - )))] + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] "SIGEMT" => Signal::SIGEMT, - #[cfg(not(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux", - target_os = "redox", - target_os = "haiku" - )))] + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] "SIGINFO" => Signal::SIGINFO, _ => return Err(Errno::EINVAL), }) @@ -218,19 +192,9 @@ impl Signal { Signal::SIGPIPE => "SIGPIPE", Signal::SIGALRM => "SIGALRM", Signal::SIGTERM => "SIGTERM", - #[cfg(all( - any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux" - ), - not(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "sparc64" - )) - ))] + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] Signal::SIGSTKFLT => "SIGSTKFLT", Signal::SIGCHLD => "SIGCHLD", Signal::SIGCONT => "SIGCONT", @@ -244,33 +208,18 @@ impl Signal { Signal::SIGVTALRM => "SIGVTALRM", Signal::SIGPROF => "SIGPROF", Signal::SIGWINCH => "SIGWINCH", - #[cfg(not(target_os = "haiku"))] Signal::SIGIO => "SIGIO", - #[cfg(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux" - ))] + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] Signal::SIGPWR => "SIGPWR", Signal::SIGSYS => "SIGSYS", - #[cfg(not(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux", - target_os = "redox", - target_os = "haiku" - )))] + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] Signal::SIGEMT => "SIGEMT", - #[cfg(not(any( - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "linux", - target_os = "redox", - target_os = "haiku" - )))] + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] Signal::SIGINFO => "SIGINFO", } } @@ -296,70 +245,144 @@ pub use self::Signal::*; #[cfg(target_os = "redox")] #[cfg(feature = "signal")] const SIGNALS: [Signal; 29] = [ - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, - SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, - SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, - SIGPROF, SIGWINCH, SIGIO, SIGSYS, -]; -#[cfg(target_os = "haiku")] -#[cfg(feature = "signal")] -const SIGNALS: [Signal; 28] = [ - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, - SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, - SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, - SIGPROF, SIGWINCH, SIGSYS, -]; -#[cfg(all( - any( - target_os = "linux", - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia" - ), - not(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "sparc64" - )) -))] + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] #[cfg(feature = "signal")] const SIGNALS: [Signal; 31] = [ - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, - SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGSTKFLT, SIGCHLD, - SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, - SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGPWR, SIGSYS, -]; -#[cfg(all( - any( - target_os = "linux", - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia" - ), - any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64") -))] + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGSTKFLT, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64")))] #[cfg(feature = "signal")] const SIGNALS: [Signal; 30] = [ - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, - SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, - SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, - SIGPROF, SIGWINCH, SIGIO, SIGPWR, SIGSYS, -]; -#[cfg(not(any( - target_os = "linux", - target_os = "android", - target_os = "fuchsia", - target_os = "emscripten", - target_os = "redox", - target_os = "haiku" -)))] + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(not(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "emscripten", + target_os = "redox")))] #[cfg(feature = "signal")] const SIGNALS: [Signal; 31] = [ - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, - SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, - SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, - SIGPROF, SIGWINCH, SIGIO, SIGSYS, SIGEMT, SIGINFO, -]; + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS, + SIGEMT, + SIGINFO]; feature! { #![feature = "signal"] @@ -394,7 +417,6 @@ impl Signal { /// Alias for [`SIGABRT`] pub const SIGIOT : Signal = SIGABRT; /// Alias for [`SIGIO`] -#[cfg(not(target_os = "haiku"))] pub const SIGPOLL : Signal = SIGIO; /// Alias for [`SIGSYS`] pub const SIGUNUSED : Signal = SIGSYS; @@ -411,7 +433,7 @@ cfg_if! { } #[cfg(feature = "signal")] -libc_bitflags! { +libc_bitflags!{ /// Controls the behavior of a [`SigAction`] #[cfg_attr(docsrs, doc(cfg(feature = "signal")))] pub struct SaFlags: SaFlags_t { @@ -465,9 +487,6 @@ use std::iter::FromIterator; use std::iter::IntoIterator; /// Specifies a set of [`Signal`]s that may be blocked, waited for, etc. -// We are using `transparent` here to be super sure that `SigSet` -// is represented exactly like the `sigset_t` struct from C. -#[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct SigSet { sigset: libc::sigset_t @@ -475,7 +494,6 @@ pub struct SigSet { impl SigSet { /// Initialize to include all signals. - #[cfg_attr(has_doc_alias, doc(alias("sigfillset")))] pub fn all() -> SigSet { let mut sigset = mem::MaybeUninit::uninit(); let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) }; @@ -484,7 +502,6 @@ impl SigSet { } /// Initialize to include nothing. - #[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))] pub fn empty() -> SigSet { let mut sigset = mem::MaybeUninit::uninit(); let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) }; @@ -493,25 +510,21 @@ impl SigSet { } /// Add the specified signal to the set. - #[cfg_attr(has_doc_alias, doc(alias("sigaddset")))] pub fn add(&mut self, signal: Signal) { unsafe { libc::sigaddset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; } /// Remove all signals from this set. - #[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))] pub fn clear(&mut self) { unsafe { libc::sigemptyset(&mut self.sigset as *mut libc::sigset_t) }; } /// Remove the specified signal from this set. - #[cfg_attr(has_doc_alias, doc(alias("sigdelset")))] pub fn remove(&mut self, signal: Signal) { unsafe { libc::sigdelset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; } /// Return whether this set includes the specified signal. - #[cfg_attr(has_doc_alias, doc(alias("sigismember")))] pub fn contains(&self, signal: Signal) -> bool { let res = unsafe { libc::sigismember(&self.sigset as *const libc::sigset_t, signal as libc::c_int) }; @@ -570,19 +583,6 @@ impl SigSet { Signal::try_from(signum.assume_init()).unwrap() }) } - - /// Converts a `libc::sigset_t` object to a [`SigSet`] without checking whether the - /// `libc::sigset_t` is already initialized. - /// - /// # Safety - /// - /// The `sigset` passed in must be a valid an initialized `libc::sigset_t` by calling either - /// [`sigemptyset(3)`](https://man7.org/linux/man-pages/man3/sigemptyset.3p.html) or - /// [`sigfillset(3)`](https://man7.org/linux/man-pages/man3/sigfillset.3p.html). - /// Otherwise, the results are undefined. - pub unsafe fn from_sigset_t_unchecked(sigset: libc::sigset_t) -> SigSet { - SigSet { sigset } - } } impl AsRef for SigSet { @@ -965,6 +965,7 @@ pub fn raise(signal: Signal) -> Result<()> { } } + feature! { #![any(feature = "aio", feature = "signal")] @@ -1124,9 +1125,9 @@ mod sigevent { #[cfg(test)] mod tests { - use super::*; #[cfg(not(target_os = "redox"))] use std::thread; + use super::*; #[test] fn test_contains() { @@ -1189,19 +1190,15 @@ mod tests { let mut test_mask = prev_mask; test_mask.add(SIGUSR1); - test_mask.thread_set_mask().expect("assertion failed"); - let new_mask = - SigSet::thread_get_mask().expect("Failed to get new mask!"); + assert!(test_mask.thread_set_mask().is_ok()); + let new_mask = SigSet::thread_get_mask() + .expect("Failed to get new mask!"); assert!(new_mask.contains(SIGUSR1)); assert!(!new_mask.contains(SIGUSR2)); - prev_mask - .thread_set_mask() - .expect("Failed to revert signal mask!"); - }) - .join() - .unwrap(); + prev_mask.thread_set_mask().expect("Failed to revert signal mask!"); + }).join().unwrap(); } #[test] @@ -1211,12 +1208,10 @@ mod tests { let mut mask = SigSet::empty(); mask.add(SIGUSR1); - mask.thread_block().expect("assertion failed"); + assert!(mask.thread_block().is_ok()); assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); - }) - .join() - .unwrap(); + }).join().unwrap(); } #[test] @@ -1226,12 +1221,10 @@ mod tests { let mut mask = SigSet::empty(); mask.add(SIGUSR1); - mask.thread_unblock().expect("assertion failed"); + assert!(mask.thread_unblock().is_ok()); assert!(!SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); - }) - .join() - .unwrap(); + }).join().unwrap(); } #[test] @@ -1247,16 +1240,14 @@ mod tests { let mut mask2 = SigSet::empty(); mask2.add(SIGUSR2); - let oldmask = - mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK).unwrap(); + let oldmask = mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK) + .unwrap(); assert!(oldmask.contains(SIGUSR1)); assert!(!oldmask.contains(SIGUSR2)); assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR2)); - }) - .join() - .unwrap(); + }).join().unwrap(); } #[test] @@ -1270,28 +1261,22 @@ mod tests { #[cfg(not(target_os = "redox"))] fn test_sigaction() { thread::spawn(|| { - extern "C" fn test_sigaction_handler(_: libc::c_int) {} - extern "C" fn test_sigaction_action( - _: libc::c_int, - _: *mut libc::siginfo_t, - _: *mut libc::c_void, - ) { - } + extern fn test_sigaction_handler(_: libc::c_int) {} + extern fn test_sigaction_action(_: libc::c_int, + _: *mut libc::siginfo_t, _: *mut libc::c_void) {} let handler_sig = SigHandler::Handler(test_sigaction_handler); - let flags = - SaFlags::SA_ONSTACK | SaFlags::SA_RESTART | SaFlags::SA_SIGINFO; + let flags = SaFlags::SA_ONSTACK | SaFlags::SA_RESTART | + SaFlags::SA_SIGINFO; let mut mask = SigSet::empty(); mask.add(SIGUSR1); let action_sig = SigAction::new(handler_sig, flags, mask); - assert_eq!( - action_sig.flags(), - SaFlags::SA_ONSTACK | SaFlags::SA_RESTART - ); + assert_eq!(action_sig.flags(), + SaFlags::SA_ONSTACK | SaFlags::SA_RESTART); assert_eq!(action_sig.handler(), handler_sig); mask = action_sig.mask(); @@ -1307,9 +1292,7 @@ mod tests { let action_ign = SigAction::new(SigHandler::SigIgn, flags, mask); assert_eq!(action_ign.handler(), SigHandler::SigIgn); - }) - .join() - .unwrap(); + }).join().unwrap(); } #[test] @@ -1323,25 +1306,6 @@ mod tests { raise(SIGUSR1).unwrap(); assert_eq!(mask.wait().unwrap(), SIGUSR1); - }) - .join() - .unwrap(); - } - - #[test] - fn test_from_sigset_t_unchecked() { - let src_set = SigSet::empty(); - let set = unsafe { SigSet::from_sigset_t_unchecked(src_set.sigset) }; - - for signal in Signal::iterator() { - assert!(!set.contains(signal)); - } - - let src_set = SigSet::all(); - let set = unsafe { SigSet::from_sigset_t_unchecked(src_set.sigset) }; - - for signal in Signal::iterator() { - assert!(set.contains(signal)); - } + }).join().unwrap(); } } diff --git a/bash-5.1/vendor/nix/src/sys/signalfd.rs b/bash-5.1/vendor/nix/src/sys/signalfd.rs index 166bb9d246c601e6fb091aa916f4f26ee2f14df3..bc4a4522439ad22789609139206caabed0e6927f 100644 --- a/bash-5.1/vendor/nix/src/sys/signalfd.rs +++ b/bash-5.1/vendor/nix/src/sys/signalfd.rs @@ -147,17 +147,15 @@ mod tests { #[test] fn create_signalfd() { let mask = SigSet::empty(); - SignalFd::new(&mask).unwrap(); + let fd = SignalFd::new(&mask); + assert!(fd.is_ok()); } #[test] fn create_signalfd_with_opts() { let mask = SigSet::empty(); - SignalFd::with_flags( - &mask, - SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK, - ) - .unwrap(); + let fd = SignalFd::with_flags(&mask, SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK); + assert!(fd.is_ok()); } #[test] diff --git a/bash-5.1/vendor/nix/src/sys/socket/addr.rs b/bash-5.1/vendor/nix/src/sys/socket/addr.rs index ad917cd08feb2fd845bd1bf41e826f7cd958f13c..52d60ac9abba09acabbbe0d0051a1d9cb3e76832 100644 --- a/bash-5.1/vendor/nix/src/sys/socket/addr.rs +++ b/bash-5.1/vendor/nix/src/sys/socket/addr.rs @@ -26,7 +26,6 @@ use crate::sys::socket::addr::sys_control::SysControlAddr; target_os = "illumos", target_os = "netbsd", target_os = "openbsd", - target_os = "haiku", target_os = "fuchsia"))] #[cfg(feature = "net")] pub use self::datalink::LinkAddr; @@ -121,7 +120,6 @@ pub enum AddressFamily { #[cfg_attr(docsrs, doc(cfg(all())))] Rose = libc::AF_ROSE, /// DECet protocol sockets. - #[cfg(not(target_os = "haiku"))] Decnet = libc::AF_DECnet, /// Reserved for "802.2LLC project"; never used. #[cfg(any(target_os = "android", target_os = "linux"))] @@ -153,7 +151,6 @@ pub enum AddressFamily { #[cfg_attr(docsrs, doc(cfg(all())))] Rds = libc::AF_RDS, /// IBM SNA - #[cfg(not(target_os = "haiku"))] Sna = libc::AF_SNA, /// Socket interface over IrDA #[cfg(any(target_os = "android", target_os = "linux"))] @@ -205,7 +202,7 @@ pub enum AddressFamily { #[cfg_attr(docsrs, doc(cfg(all())))] RxRpc = libc::AF_RXRPC, /// New "modular ISDN" driver interface protocol - #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] #[cfg_attr(docsrs, doc(cfg(all())))] Isdn = libc::AF_ISDN, /// Nokia cellular modem IPC/RPC interface @@ -1161,7 +1158,6 @@ impl SockaddrIn { target_os = "ios", target_os = "macos", target_os = "netbsd", - target_os = "haiku", target_os = "openbsd"))] sin_len: Self::size() as u8, sin_family: AddressFamily::Inet as sa_family_t, @@ -1195,7 +1191,7 @@ impl SockaddrLike for SockaddrIn { if (*addr).sa_family as i32 != libc::AF_INET as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(SockaddrIn(*(addr as *const libc::sockaddr_in))) } } @@ -1237,16 +1233,6 @@ impl From for SockaddrIn { } } -#[cfg(feature = "net")] -impl From for net::SocketAddrV4 { - fn from(addr: SockaddrIn) -> Self { - net::SocketAddrV4::new( - net::Ipv4Addr::from(addr.0.sin_addr.s_addr.to_ne_bytes()), - u16::from_be(addr.0.sin_port) - ) - } -} - #[cfg(feature = "net")] impl std::str::FromStr for SockaddrIn { type Err = net::AddrParseError; @@ -1301,7 +1287,7 @@ impl SockaddrLike for SockaddrIn6 { if (*addr).sa_family as i32 != libc::AF_INET6 as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(SockaddrIn6(*(addr as *const libc::sockaddr_in6))) } } @@ -1343,18 +1329,6 @@ impl From for SockaddrIn6 { } } -#[cfg(feature = "net")] -impl From for net::SocketAddrV6 { - fn from(addr: SockaddrIn6) -> Self { - net::SocketAddrV6::new( - net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr), - u16::from_be(addr.0.sin6_port), - u32::from_be(addr.0.sin6_flowinfo), - u32::from_be(addr.0.sin6_scope_id) - ) - } -} - #[cfg(feature = "net")] impl std::str::FromStr for SockaddrIn6 { type Err = net::AddrParseError; @@ -1446,7 +1420,6 @@ impl SockaddrLike for SockaddrStorage { target_os = "macos", target_os = "illumos", target_os = "netbsd", - target_os = "haiku", target_os = "openbsd"))] #[cfg(feature = "net")] libc::AF_LINK => LinkAddr::from_raw(addr, l) @@ -1514,14 +1487,6 @@ impl SockaddrStorage { accessors!{as_alg_addr, as_alg_addr_mut, AlgAddr, AddressFamily::Alg, libc::sockaddr_alg, alg} - #[cfg(any(target_os = "android", - target_os = "fuchsia", - target_os = "linux"))] - #[cfg(feature = "net")] - accessors!{ - as_link_addr, as_link_addr_mut, LinkAddr, - AddressFamily::Packet, libc::sockaddr_ll, dl} - #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", @@ -1870,21 +1835,21 @@ impl SockAddr { Some(AddressFamily::Unix) => None, #[cfg(feature = "net")] Some(AddressFamily::Inet) => Some(SockAddr::Inet( - InetAddr::V4(ptr::read_unaligned(addr as *const _)))), + InetAddr::V4(*(addr as *const libc::sockaddr_in)))), #[cfg(feature = "net")] Some(AddressFamily::Inet6) => Some(SockAddr::Inet( - InetAddr::V6(ptr::read_unaligned(addr as *const _)))), + InetAddr::V6(*(addr as *const libc::sockaddr_in6)))), #[cfg(any(target_os = "android", target_os = "linux"))] Some(AddressFamily::Netlink) => Some(SockAddr::Netlink( - NetlinkAddr(ptr::read_unaligned(addr as *const _)))), + NetlinkAddr(*(addr as *const libc::sockaddr_nl)))), #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] Some(AddressFamily::System) => Some(SockAddr::SysControl( - SysControlAddr(ptr::read_unaligned(addr as *const _)))), + SysControlAddr(*(addr as *const libc::sockaddr_ctl)))), #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg(feature = "net")] Some(AddressFamily::Packet) => Some(SockAddr::Link( - LinkAddr(ptr::read_unaligned(addr as *const _)))), + LinkAddr(*(addr as *const libc::sockaddr_ll)))), #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", @@ -1894,7 +1859,7 @@ impl SockAddr { target_os = "openbsd"))] #[cfg(feature = "net")] Some(AddressFamily::Link) => { - let ether_addr = LinkAddr(ptr::read_unaligned(addr as *const _)); + let ether_addr = LinkAddr(*(addr as *const libc::sockaddr_dl)); if ether_addr.is_empty() { None } else { @@ -1903,7 +1868,7 @@ impl SockAddr { }, #[cfg(any(target_os = "android", target_os = "linux"))] Some(AddressFamily::Vsock) => Some(SockAddr::Vsock( - VsockAddr(ptr::read_unaligned(addr as *const _)))), + VsockAddr(*(addr as *const libc::sockaddr_vm)))), // Other address families are currently not supported and simply yield a None // entry instead of a proper conversion to a `SockAddr`. Some(_) | None => None, @@ -2104,7 +2069,7 @@ pub mod netlink { if (*addr).sa_family as i32 != libc::AF_NETLINK as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(NetlinkAddr(*(addr as *const libc::sockaddr_nl))) } } @@ -2148,7 +2113,7 @@ pub mod alg { if (*addr).sa_family as i32 != libc::AF_ALG as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(AlgAddr(*(addr as *const libc::sockaddr_alg))) } } @@ -2220,7 +2185,7 @@ feature! { pub mod sys_control { use crate::sys::socket::addr::AddressFamily; use libc::{self, c_uchar}; - use std::{fmt, mem, ptr}; + use std::{fmt, mem}; use std::os::unix::io::RawFd; use crate::{Errno, Result}; use super::{private, SockaddrLike}; @@ -2259,10 +2224,10 @@ pub mod sys_control { return None; } } - if (*addr).sa_family as i32 != libc::AF_SYSTEM as i32 { + if (*addr).sa_family as i32 != libc::AF_INET6 as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(SysControlAddr(*(addr as *const libc::sockaddr_ctl))) } } @@ -2329,7 +2294,7 @@ pub mod sys_control { mod datalink { feature! { #![feature = "net"] - use super::{fmt, mem, private, ptr, SockaddrLike}; + use super::{fmt, mem, private, SockaddrLike}; /// Hardware Address #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -2405,7 +2370,7 @@ mod datalink { if (*addr).sa_family as i32 != libc::AF_PACKET as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(LinkAddr(*(addr as *const libc::sockaddr_ll))) } } @@ -2424,13 +2389,12 @@ mod datalink { target_os = "macos", target_os = "illumos", target_os = "netbsd", - target_os = "haiku", target_os = "openbsd"))] #[cfg_attr(docsrs, doc(cfg(all())))] mod datalink { feature! { #![feature = "net"] - use super::{fmt, mem, private, ptr, SockaddrLike}; + use super::{fmt, mem, private, SockaddrLike}; /// Hardware Address #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -2439,13 +2403,11 @@ mod datalink { impl LinkAddr { /// interface index, if != 0, system given index for interface - #[cfg(not(target_os = "haiku"))] pub fn ifindex(&self) -> usize { self.0.sdl_index as usize } /// Datalink type - #[cfg(not(target_os = "haiku"))] pub fn datalink_type(&self) -> u8 { self.0.sdl_type } @@ -2461,7 +2423,6 @@ mod datalink { } /// link layer selector length - #[cfg(not(target_os = "haiku"))] pub fn slen(&self) -> usize { self.0.sdl_slen as usize } @@ -2525,7 +2486,7 @@ mod datalink { if (*addr).sa_family as i32 != libc::AF_LINK as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(LinkAddr(*(addr as *const libc::sockaddr_dl))) } } @@ -2566,10 +2527,10 @@ pub mod vsock { return None; } } - if (*addr).sa_family as i32 != libc::AF_VSOCK as i32 { + if (*addr).sa_family as i32 != libc::AF_INET6 as i32 { return None; } - Some(Self(ptr::read_unaligned(addr as *const _))) + Some(VsockAddr(*(addr as *const libc::sockaddr_vm))) } } @@ -2658,8 +2619,6 @@ mod tests { } mod link { - #![allow(clippy::cast_ptr_alignment)] - use super::*; #[cfg(any(target_os = "ios", target_os = "macos", @@ -2692,28 +2651,6 @@ mod tests { format!("{}", la); } - #[cfg(all( - any(target_os = "android", - target_os = "fuchsia", - target_os = "linux"), - target_endian = "little" - ))] - #[test] - fn linux_loopback() { - #[repr(align(2))] - struct Raw([u8; 20]); - - let bytes = Raw([17u8, 0, 0, 0, 1, 0, 0, 0, 4, 3, 0, 6, 1, 2, 3, 4, 5, 6, 0, 0]); - let sa = bytes.0.as_ptr() as *const libc::sockaddr; - let len = None; - let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }.unwrap(); - assert_eq!(sock_addr.family(), Some(AddressFamily::Packet)); - match sock_addr.as_link_addr() { - Some(dl) => assert_eq!(dl.addr(), Some([1, 2, 3, 4, 5, 6])), - None => panic!("Can't unwrap sockaddr storage") - } - } - #[cfg(any(target_os = "ios", target_os = "macos" ))] @@ -2778,8 +2715,7 @@ mod tests { target_os = "macos", target_os = "netbsd", target_os = "illumos", - target_os = "openbsd", - target_os = "haiku"))] + target_os = "openbsd"))] let l = mem::size_of::(); #[cfg(any( target_os = "android", diff --git a/bash-5.1/vendor/nix/src/sys/socket/mod.rs b/bash-5.1/vendor/nix/src/sys/socket/mod.rs index ecbf30ad44cd65776b08d75ace84034e4ec2a58b..c661389200572eeb66732a008bf0d1bd9db17d2d 100644 --- a/bash-5.1/vendor/nix/src/sys/socket/mod.rs +++ b/bash-5.1/vendor/nix/src/sys/socket/mod.rs @@ -38,7 +38,7 @@ pub use self::addr::{ UnixAddr, }; #[allow(deprecated)] -#[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] #[cfg(feature = "net")] pub use self::addr::{ InetAddr, @@ -57,7 +57,7 @@ pub use self::addr::{ UnixAddr, }; #[allow(deprecated)] -#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))] +#[cfg(any(target_os = "illumos", target_os = "solaris"))] #[cfg(feature = "net")] pub use self::addr::{ InetAddr, @@ -118,7 +118,6 @@ pub enum SockType { Raw = libc::SOCK_RAW, /// Provides a reliable datagram layer that does not /// guarantee ordering. - #[cfg(not(any(target_os = "haiku")))] Rdm = libc::SOCK_RDM, } @@ -214,13 +213,6 @@ pub enum SockProtocol { #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg_attr(docsrs, doc(cfg(all())))] NetlinkCrypto = libc::NETLINK_CRYPTO, - /// Non-DIX type protocol number defined for the Ethernet IEEE 802.3 interface that allows packets of all protocols - /// defined in the interface to be received. - /// ([ref](https://man7.org/linux/man-pages/man7/packet.7.html)) - // The protocol number is fed into the socket syscall in network byte order. - #[cfg(any(target_os = "android", target_os = "linux"))] - #[cfg_attr(docsrs, doc(cfg(all())))] - EthAll = libc::ETH_P_ALL.to_be(), } #[cfg(any(target_os = "linux"))] @@ -677,7 +669,7 @@ pub enum ControlMessageOwned { /// None).unwrap(); /// setsockopt(in_socket, sockopt::ReceiveTimestamp, &true).unwrap(); /// let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); - /// bind(in_socket, &localhost).unwrap(); + /// bind(in_socket, &localhost); /// let address: SockaddrIn = getsockname(in_socket).unwrap(); /// // Get initial time /// let time0 = SystemTime::now(); @@ -764,14 +756,6 @@ pub enum ControlMessageOwned { #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv4RecvDstAddr(libc::in_addr), - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] - #[cfg(feature = "net")] - #[cfg_attr(docsrs, doc(cfg(feature = "net")))] - Ipv4OrigDstAddr(libc::sockaddr_in), - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] - #[cfg(feature = "net")] - #[cfg_attr(docsrs, doc(cfg(feature = "net")))] - Ipv6OrigDstAddr(libc::sockaddr_in6), /// UDP Generic Receive Offload (GRO) allows receiving multiple UDP /// packets from a single sender. @@ -861,7 +845,6 @@ impl ControlMessageOwned { let cred: libc::cmsgcred = ptr::read_unaligned(p as *const _); ControlMessageOwned::ScmCreds(cred.into()) } - #[cfg(not(target_os = "haiku"))] (libc::SOL_SOCKET, libc::SCM_TIMESTAMP) => { let tv: libc::timeval = ptr::read_unaligned(p as *const _); ControlMessageOwned::ScmTimestamp(TimeVal::from(tv)) @@ -931,12 +914,6 @@ impl ControlMessageOwned { let dl = ptr::read_unaligned(p as *const libc::in_addr); ControlMessageOwned::Ipv4RecvDstAddr(dl) }, - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] - #[cfg(feature = "net")] - (libc::IPPROTO_IP, libc::IP_ORIGDSTADDR) => { - let dl = ptr::read_unaligned(p as *const libc::sockaddr_in); - ControlMessageOwned::Ipv4OrigDstAddr(dl) - }, #[cfg(target_os = "linux")] #[cfg(feature = "net")] (libc::SOL_UDP, libc::UDP_GRO) => { @@ -960,12 +937,6 @@ impl ControlMessageOwned { let (err, addr) = Self::recv_err_helper::(p, len); ControlMessageOwned::Ipv6RecvErr(err, addr) }, - #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] - #[cfg(feature = "net")] - (libc::IPPROTO_IPV6, libc::IPV6_ORIGDSTADDR) => { - let dl = ptr::read_unaligned(p as *const libc::sockaddr_in6); - ControlMessageOwned::Ipv6OrigDstAddr(dl) - }, (_, _) => { let sl = slice::from_raw_parts(p, len); let ucmsg = UnknownCmsg(*header, Vec::::from(sl)); @@ -976,7 +947,6 @@ impl ControlMessageOwned { #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg(feature = "net")] - #[allow(clippy::cast_ptr_alignment)] // False positive unsafe fn recv_err_helper(p: *mut libc::c_uchar, len: usize) -> (libc::sock_extended_err, Option) { let ee = p as *const libc::sock_extended_err; let err = ptr::read_unaligned(ee); @@ -1117,17 +1087,6 @@ pub enum ControlMessage<'a> { #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv6PacketInfo(&'a libc::in6_pktinfo), - /// Configure the IPv4 source address with `IP_SENDSRCADDR`. - #[cfg(any( - target_os = "netbsd", - target_os = "freebsd", - target_os = "openbsd", - target_os = "dragonfly", - ))] - #[cfg(feature = "net")] - #[cfg_attr(docsrs, doc(cfg(feature = "net")))] - Ipv4SendSrcAddr(&'a libc::in_addr), - /// SO_RXQ_OVFL indicates that an unsigned 32 bit value /// ancilliary msg (cmsg) should be attached to recieved /// skbs indicating the number of packets dropped by the @@ -1237,10 +1196,6 @@ impl<'a> ControlMessage<'a> { target_os = "android", target_os = "ios",))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8, - #[cfg(any(target_os = "netbsd", target_os = "freebsd", - target_os = "openbsd", target_os = "dragonfly"))] - #[cfg(feature = "net")] - ControlMessage::Ipv4SendSrcAddr(addr) => addr as *const _ as *const u8, #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] ControlMessage::RxqOvfl(drop_count) => { drop_count as *const _ as *const u8 @@ -1300,10 +1255,6 @@ impl<'a> ControlMessage<'a> { target_os = "android", target_os = "ios",))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info), - #[cfg(any(target_os = "netbsd", target_os = "freebsd", - target_os = "openbsd", target_os = "dragonfly"))] - #[cfg(feature = "net")] - ControlMessage::Ipv4SendSrcAddr(addr) => mem::size_of_val(addr), #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] ControlMessage::RxqOvfl(drop_count) => { mem::size_of_val(drop_count) @@ -1339,10 +1290,6 @@ impl<'a> ControlMessage<'a> { target_os = "android", target_os = "ios",))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6, - #[cfg(any(target_os = "netbsd", target_os = "freebsd", - target_os = "openbsd", target_os = "dragonfly"))] - #[cfg(feature = "net")] - ControlMessage::Ipv4SendSrcAddr(_) => libc::IPPROTO_IP, #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] ControlMessage::RxqOvfl(_) => libc::SOL_SOCKET, #[cfg(target_os = "linux")] @@ -1385,10 +1332,6 @@ impl<'a> ControlMessage<'a> { target_os = "android", target_os = "ios",))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO, - #[cfg(any(target_os = "netbsd", target_os = "freebsd", - target_os = "openbsd", target_os = "dragonfly"))] - #[cfg(feature = "net")] - ControlMessage::Ipv4SendSrcAddr(_) => libc::IP_SENDSRCADDR, #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] ControlMessage::RxqOvfl(_) => { libc::SO_RXQ_OVFL @@ -1967,8 +1910,8 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) -> Result<(usize, Option)> { unsafe { - let mut addr = mem::MaybeUninit::::uninit(); - let mut len = mem::size_of_val(&addr) as socklen_t; + let mut addr = mem::MaybeUninit::uninit(); + let mut len = mem::size_of::() as socklen_t; let ret = Errno::result(libc::recvfrom( sockfd, @@ -1978,10 +1921,7 @@ pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) addr.as_mut_ptr() as *mut libc::sockaddr, &mut len as *mut socklen_t))? as usize; - Ok((ret, T::from_raw( - addr.assume_init().as_ptr() as *const libc::sockaddr, - Some(len)) - )) + Ok((ret, T::from_raw(&addr.assume_init(), Some(len)))) } } diff --git a/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs b/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs index 1cbb223ece1fae17f3d7326f3001196180da78fc..e80b09e77191cac576097346c9171a93dbe41b1c 100644 --- a/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs +++ b/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs @@ -129,9 +129,6 @@ macro_rules! getsockopt_impl { /// * `$ty:ty`: type of the value that will be get/set. /// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`. /// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`. -// Some targets don't use all rules. -#[allow(unknown_lints)] -#[allow(unused_macro_rules)] macro_rules! sockopt_impl { ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, bool) => { sockopt_impl!($(#[$attr])* @@ -352,9 +349,6 @@ sockopt_impl!( sockopt_impl!( /// Get and clear the pending socket error. SocketError, GetOnly, libc::SOL_SOCKET, libc::SO_ERROR, i32); -sockopt_impl!( - /// Set or get the don't route flag. - DontRoute, Both, libc::SOL_SOCKET, libc::SO_DONTROUTE, bool); sockopt_impl!( /// Enable sending of keep-alive messages on connection-oriented sockets. KeepAlive, Both, libc::SOL_SOCKET, libc::SO_KEEPALIVE, bool); @@ -383,7 +377,8 @@ sockopt_impl!( #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", - target_os = "linux"))] + target_os = "linux", + target_os = "nacl"))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] @@ -401,7 +396,7 @@ cfg_if! { TcpMaxSeg, GetOnly, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); } } -#[cfg(not(any(target_os = "openbsd", target_os = "haiku")))] +#[cfg(not(target_os = "openbsd"))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] @@ -415,7 +410,7 @@ sockopt_impl!( #[allow(missing_docs)] // Not documented by Linux! TcpRepair, Both, libc::IPPROTO_TCP, libc::TCP_REPAIR, u32); -#[cfg(not(any(target_os = "openbsd", target_os = "haiku")))] +#[cfg(not(target_os = "openbsd"))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] @@ -475,7 +470,6 @@ sockopt_impl!( /// Specifies exact type of timestamping information collected by the kernel /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) Timestamping, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPING, super::TimestampingFlag); -#[cfg(not(target_os = "haiku"))] sockopt_impl!( /// Enable or disable the receiving of the `SO_TIMESTAMP` control message. ReceiveTimestamp, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool); @@ -574,13 +568,6 @@ sockopt_impl!( /// The `recvmsg(2)` call will return the destination IP address for a UDP /// datagram. Ipv4RecvDstAddr, Both, libc::IPPROTO_IP, libc::IP_RECVDSTADDR, bool); -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] -#[cfg(feature = "net")] -sockopt_impl!( - #[cfg_attr(docsrs, doc(cfg(feature = "net")))] - /// The `recvmsg(2)` call will return the destination IP address for a UDP - /// datagram. - Ipv4OrigDstAddr, Both, libc::IPPROTO_IP, libc::IP_ORIGDSTADDR, bool); #[cfg(target_os = "linux")] #[cfg(feature = "net")] sockopt_impl!( @@ -628,13 +615,6 @@ sockopt_impl!( sockopt_impl!( /// Set the unicast hop limit for the socket. Ipv6Ttl, Both, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int); -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] -#[cfg(feature = "net")] -sockopt_impl!( - #[cfg_attr(docsrs, doc(cfg(feature = "net")))] - /// The `recvmsg(2)` call will return the destination IP address for a UDP - /// datagram. - Ipv6OrigDstAddr, Both, libc::IPPROTO_IPV6, libc::IPV6_ORIGDSTADDR, bool); #[cfg(any(target_os = "ios", target_os = "macos"))] sockopt_impl!( /// Set "don't fragment packet" flag on the IP packet. @@ -982,7 +962,7 @@ mod test { let a_cred = getsockopt(a, super::PeerCredentials).unwrap(); let b_cred = getsockopt(b, super::PeerCredentials).unwrap(); assert_eq!(a_cred, b_cred); - assert_ne!(a_cred.pid(), 0); + assert!(a_cred.pid() != 0); } #[test] @@ -1009,7 +989,8 @@ mod test { } #[cfg(any(target_os = "freebsd", - target_os = "linux"))] + target_os = "linux", + target_os = "nacl"))] #[test] fn can_get_listen_on_tcp_socket() { use super::super::*; diff --git a/bash-5.1/vendor/nix/src/sys/stat.rs b/bash-5.1/vendor/nix/src/sys/stat.rs index 8b7627d5bcc30fc9fccfcdb2d5cfd158b4985085..67a1b7f7698437aa0111c911960198ba87a151f3 100644 --- a/bash-5.1/vendor/nix/src/sys/stat.rs +++ b/bash-5.1/vendor/nix/src/sys/stat.rs @@ -1,12 +1,4 @@ pub use libc::{dev_t, mode_t}; -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "openbsd"))] -pub use libc::c_uint; -#[cfg(any( - target_os = "netbsd", - target_os = "freebsd", - target_os = "dragonfly" -))] -pub use libc::c_ulong; pub use libc::stat as FileStat; use crate::{Result, NixPath, errno::Errno}; @@ -51,110 +43,6 @@ libc_bitflags! { } } -#[cfg(any(target_os = "macos", target_os = "ios", target_os="openbsd"))] -pub type type_of_file_flag = c_uint; -#[cfg(any( - target_os = "netbsd", - target_os = "freebsd", - target_os = "dragonfly" -))] -pub type type_of_file_flag = c_ulong; - -#[cfg(any( - target_os = "openbsd", - target_os = "netbsd", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "macos", - target_os = "ios" -))] -libc_bitflags! { - /// File flags. - #[cfg_attr(docsrs, doc(cfg(all())))] - pub struct FileFlag: type_of_file_flag { - /// The file may only be appended to. - SF_APPEND; - /// The file has been archived. - SF_ARCHIVED; - #[cfg(any(target_os = "dragonfly"))] - SF_CACHE; - /// The file may not be changed. - SF_IMMUTABLE; - /// Indicates a WAPBL journal file. - #[cfg(any(target_os = "netbsd"))] - SF_LOG; - /// Do not retain history for file - #[cfg(any(target_os = "dragonfly"))] - SF_NOHISTORY; - /// The file may not be renamed or deleted. - #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] - SF_NOUNLINK; - /// Mask of superuser changeable flags - SF_SETTABLE; - /// Snapshot is invalid. - #[cfg(any(target_os = "netbsd"))] - SF_SNAPINVAL; - /// The file is a snapshot file. - #[cfg(any(target_os = "netbsd", target_os = "freebsd"))] - SF_SNAPSHOT; - #[cfg(any(target_os = "dragonfly"))] - SF_XLINK; - /// The file may only be appended to. - UF_APPEND; - /// The file needs to be archived. - #[cfg(any(target_os = "freebsd"))] - UF_ARCHIVE; - #[cfg(any(target_os = "dragonfly"))] - UF_CACHE; - /// File is compressed at the file system level. - #[cfg(any(target_os = "macos", target_os = "ios"))] - UF_COMPRESSED; - /// The file may be hidden from directory listings at the application's - /// discretion. - #[cfg(any( - target_os = "freebsd", - target_os = "macos", - target_os = "ios", - ))] - UF_HIDDEN; - /// The file may not be changed. - UF_IMMUTABLE; - /// Do not dump the file. - UF_NODUMP; - #[cfg(any(target_os = "dragonfly"))] - UF_NOHISTORY; - /// The file may not be renamed or deleted. - #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] - UF_NOUNLINK; - /// The file is offline, or has the Windows and CIFS - /// `FILE_ATTRIBUTE_OFFLINE` attribute. - #[cfg(any(target_os = "freebsd"))] - UF_OFFLINE; - /// The directory is opaque when viewed through a union stack. - UF_OPAQUE; - /// The file is read only, and may not be written or appended. - #[cfg(any(target_os = "freebsd"))] - UF_READONLY; - /// The file contains a Windows reparse point. - #[cfg(any(target_os = "freebsd"))] - UF_REPARSE; - /// Mask of owner changeable flags. - UF_SETTABLE; - /// The file has the Windows `FILE_ATTRIBUTE_SPARSE_FILE` attribute. - #[cfg(any(target_os = "freebsd"))] - UF_SPARSE; - /// The file has the DOS, Windows and CIFS `FILE_ATTRIBUTE_SYSTEM` - /// attribute. - #[cfg(any(target_os = "freebsd"))] - UF_SYSTEM; - /// File renames and deletes are tracked. - #[cfg(any(target_os = "macos", target_os = "ios"))] - UF_TRACKED; - #[cfg(any(target_os = "dragonfly"))] - UF_XLINK; - } -} - /// Create a special or ordinary file, by pathname. pub fn mknod(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> { let res = path.with_nix_path(|cstr| unsafe { @@ -165,7 +53,7 @@ pub fn mknod(path: &P, kind: SFlag, perm: Mode, dev: dev_t) } /// Create a special or ordinary file, relative to a given directory. -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] #[cfg_attr(docsrs, doc(cfg(all())))] pub fn mknodat( dirfd: RawFd, diff --git a/bash-5.1/vendor/nix/src/sys/statfs.rs b/bash-5.1/vendor/nix/src/sys/statfs.rs index e8c06e4e3fa27115e3deca2bc404483c75877f01..5a7ac11aff72af07d3f0254175182879419ac58e 100644 --- a/bash-5.1/vendor/nix/src/sys/statfs.rs +++ b/bash-5.1/vendor/nix/src/sys/statfs.rs @@ -49,160 +49,160 @@ pub struct FsType(pub fs_type_t); // These constants are defined without documentation in the Linux headers, so we // can't very well document them here. -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const AFS_SUPER_MAGIC: FsType = FsType(libc::AFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const AUTOFS_SUPER_MAGIC: FsType = FsType(libc::AUTOFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const BPF_FS_MAGIC: FsType = FsType(libc::BPF_FS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const BTRFS_SUPER_MAGIC: FsType = FsType(libc::BTRFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const DEBUGFS_MAGIC: FsType = FsType(libc::DEBUGFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const DEVPTS_SUPER_MAGIC: FsType = FsType(libc::DEVPTS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const ECRYPTFS_SUPER_MAGIC: FsType = FsType(libc::ECRYPTFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const F2FS_SUPER_MAGIC: FsType = FsType(libc::F2FS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const FUSE_SUPER_MAGIC: FsType = FsType(libc::FUSE_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const FUTEXFS_SUPER_MAGIC: FsType = FsType(libc::FUTEXFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const HOSTFS_SUPER_MAGIC: FsType = FsType(libc::HOSTFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MINIX3_SUPER_MAGIC: FsType = FsType(libc::MINIX3_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const NILFS_SUPER_MAGIC: FsType = FsType(libc::NILFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const OCFS2_SUPER_MAGIC: FsType = FsType(libc::OCFS2_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const QNX6_SUPER_MAGIC: FsType = FsType(libc::QNX6_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const RDTGROUP_SUPER_MAGIC: FsType = FsType(libc::RDTGROUP_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const SECURITYFS_MAGIC: FsType = FsType(libc::SECURITYFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const SELINUX_MAGIC: FsType = FsType(libc::SELINUX_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const SMACK_MAGIC: FsType = FsType(libc::SMACK_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const SYSFS_MAGIC: FsType = FsType(libc::SYSFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const TRACEFS_MAGIC: FsType = FsType(libc::TRACEFS_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const UDF_SUPER_MAGIC: FsType = FsType(libc::UDF_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t); -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] #[allow(missing_docs)] pub const XENFS_SUPER_MAGIC: FsType = FsType(libc::XENFS_SUPER_MAGIC as fs_type_t); diff --git a/bash-5.1/vendor/nix/src/sys/statvfs.rs b/bash-5.1/vendor/nix/src/sys/statvfs.rs index 38b1fdcc50af0f3932af75bd4219fd4866a8a920..ab54b4b50b9fef428769bae9be83a1f5cf8ca744 100644 --- a/bash-5.1/vendor/nix/src/sys/statvfs.rs +++ b/bash-5.1/vendor/nix/src/sys/statvfs.rs @@ -16,10 +16,8 @@ libc_bitflags!( #[derive(Default)] pub struct FsFlags: c_ulong { /// Read Only - #[cfg(not(target_os = "haiku"))] ST_RDONLY; /// Do not allow the set-uid bits to have an effect - #[cfg(not(target_os = "haiku"))] ST_NOSUID; /// Do not interpret character or block-special devices #[cfg(any(target_os = "android", target_os = "linux"))] diff --git a/bash-5.1/vendor/nix/src/sys/sysinfo.rs b/bash-5.1/vendor/nix/src/sys/sysinfo.rs index 96f043307552739e6bc63e1aafb04f36231a966e..dc943c1adce12454034a9bd31f0860a2c8dc3660 100644 --- a/bash-5.1/vendor/nix/src/sys/sysinfo.rs +++ b/bash-5.1/vendor/nix/src/sys/sysinfo.rs @@ -1,9 +1,9 @@ use libc::{self, SI_LOAD_SHIFT}; -use std::time::Duration; use std::{cmp, mem}; +use std::time::Duration; -use crate::errno::Errno; use crate::Result; +use crate::errno::Errno; /// System info structure returned by `sysinfo`. #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] @@ -75,5 +75,5 @@ impl SysInfo { pub fn sysinfo() -> Result { let mut info = mem::MaybeUninit::uninit(); let res = unsafe { libc::sysinfo(info.as_mut_ptr()) }; - Errno::result(res).map(|_| unsafe { SysInfo(info.assume_init()) }) + Errno::result(res).map(|_| unsafe{ SysInfo(info.assume_init()) }) } diff --git a/bash-5.1/vendor/nix/src/sys/termios.rs b/bash-5.1/vendor/nix/src/sys/termios.rs index c5b27d28ea0ac4b7ea59ef797a43704869ca5ac2..8870f6be7b30d8007ff0e8e83658394994ae56be 100644 --- a/bash-5.1/vendor/nix/src/sys/termios.rs +++ b/bash-5.1/vendor/nix/src/sys/termios.rs @@ -64,9 +64,9 @@ //! # use nix::sys::termios::{BaudRate, cfsetispeed, cfsetospeed, cfsetspeed, Termios}; //! # fn main() { //! # let mut t: Termios = unsafe { std::mem::zeroed() }; -//! cfsetispeed(&mut t, BaudRate::B9600).unwrap(); -//! cfsetospeed(&mut t, BaudRate::B9600).unwrap(); -//! cfsetspeed(&mut t, BaudRate::B9600).unwrap(); +//! cfsetispeed(&mut t, BaudRate::B9600); +//! cfsetospeed(&mut t, BaudRate::B9600); +//! cfsetspeed(&mut t, BaudRate::B9600); //! # } //! ``` //! @@ -76,10 +76,10 @@ //! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetispeed, cfsetspeed, Termios}; //! # fn main() { //! # let mut t: Termios = unsafe { std::mem::zeroed() }; -//! # cfsetspeed(&mut t, BaudRate::B9600).unwrap(); +//! # cfsetspeed(&mut t, BaudRate::B9600); //! let speed = cfgetispeed(&t); //! assert_eq!(speed, cfgetospeed(&t)); -//! cfsetispeed(&mut t, speed).unwrap(); +//! cfsetispeed(&mut t, speed); //! # } //! ``` //! @@ -255,9 +255,8 @@ libc_enum!{ /// enum. /// /// B0 is special and will disable the port. - #[cfg_attr(all(any(target_os = "haiku"), target_pointer_width = "64"), repr(u8))] #[cfg_attr(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64"), repr(u64))] - #[cfg_attr(not(all(any(target_os = "ios", target_os = "macos", target_os = "haiku"), target_pointer_width = "64")), repr(u32))] + #[cfg_attr(not(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64")), repr(u32))] #[non_exhaustive] pub enum BaudRate { B0, @@ -375,14 +374,6 @@ impl From for u32 { } } -#[cfg(target_os = "haiku")] -impl From for u8 { - fn from(b: BaudRate) -> u8 { - b as u8 - } -} - - // TODO: Add TCSASOFT, which will require treating this as a bitfield. libc_enum! { /// Specify when a port configuration change should occur. @@ -435,7 +426,6 @@ libc_enum! { } // TODO: Make this usable directly as a slice index. -#[cfg(not(target_os = "haiku"))] libc_enum! { /// Indices into the `termios.c_cc` array for special characters. #[repr(usize)] @@ -534,7 +524,7 @@ libc_bitflags! { #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] IXANY; - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] IMAXBEL; #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] @@ -861,7 +851,7 @@ libc_bitflags! { #[cfg_attr(docsrs, doc(cfg(all())))] ALTWERASE; IEXTEN; - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] EXTPROC; TOSTOP; @@ -989,7 +979,6 @@ cfg_if!{ /// /// `cfsetspeed()` sets the input and output baud rate in the given `Termios` structure. Note that /// this is part of the 4.4BSD standard and not part of POSIX. - #[cfg(not(target_os = "haiku"))] pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { let inner_termios = unsafe { termios.get_libc_termios_mut() }; let res = unsafe { libc::cfsetspeed(inner_termios, baud as libc::speed_t) }; @@ -1106,9 +1095,6 @@ mod test { #[test] fn try_from() { assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0)); - #[cfg(not(target_os = "haiku"))] - BaudRate::try_from(999999999).expect_err("assertion failed"); - #[cfg(target_os = "haiku")] - BaudRate::try_from(99).expect_err("assertion failed"); + assert!(BaudRate::try_from(999999999).is_err()); } } diff --git a/bash-5.1/vendor/nix/src/sys/time.rs b/bash-5.1/vendor/nix/src/sys/time.rs index 0cac7e8a2975dee05269edaab123954ea4606716..1e62b76a90d5135dde48f52d10f76056489d3dbf 100644 --- a/bash-5.1/vendor/nix/src/sys/time.rs +++ b/bash-5.1/vendor/nix/src/sys/time.rs @@ -1,10 +1,9 @@ -#[cfg_attr(target_env = "musl", allow(deprecated))] -// https://github.com/rust-lang/libc/issues/1848 -pub use libc::{suseconds_t, time_t}; -use libc::{timespec, timeval}; -use std::convert::From; -use std::time::Duration; use std::{cmp, fmt, ops}; +use std::time::Duration; +use std::convert::From; +use libc::{timespec, timeval}; +#[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 +pub use libc::{time_t, suseconds_t}; #[cfg(any( all(feature = "time", any(target_os = "android", target_os = "linux")), @@ -63,12 +62,10 @@ pub(crate) mod timer { }, it_value: *t.as_ref(), }), - Expiration::IntervalDelayed(start, interval) => { - TimerSpec(libc::itimerspec { - it_interval: *interval.as_ref(), - it_value: *start.as_ref(), - }) - } + Expiration::IntervalDelayed(start, interval) => TimerSpec(libc::itimerspec { + it_interval: *interval.as_ref(), + it_value: *start.as_ref(), + }), Expiration::Interval(t) => TimerSpec(libc::itimerspec { it_interval: *t.as_ref(), it_value: *t.as_ref(), @@ -79,7 +76,7 @@ pub(crate) mod timer { /// An enumeration allowing the definition of the expiration time of an alarm, /// recurring or not. - #[derive(Debug, Clone, Copy, Eq, PartialEq)] + #[derive(Debug, Clone, Copy, PartialEq)] pub enum Expiration { /// Alarm will trigger once after the time given in `TimeSpec` OneShot(TimeSpec), @@ -97,12 +94,7 @@ pub(crate) mod timer { const TFD_TIMER_ABSTIME = libc::TFD_TIMER_ABSTIME; } } - #[cfg(any( - target_os = "freebsd", - target_os = "netbsd", - target_os = "dragonfly", - target_os = "illumos" - ))] + #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "dragonfly", target_os = "illumos"))] bitflags! { /// Flags that are used for arming the timer. pub struct TimerSetTimeFlags: libc::c_int { @@ -125,15 +117,10 @@ pub(crate) mod timer { it_interval: int_ts, it_value: val_ts, }) => { - if (int_ts.tv_sec == val_ts.tv_sec) - && (int_ts.tv_nsec == val_ts.tv_nsec) - { + if (int_ts.tv_sec == val_ts.tv_sec) && (int_ts.tv_nsec == val_ts.tv_nsec) { Expiration::Interval(int_ts.into()) } else { - Expiration::IntervalDelayed( - val_ts.into(), - int_ts.into(), - ) + Expiration::IntervalDelayed(val_ts.into(), int_ts.into()) } } } @@ -149,16 +136,14 @@ pub trait TimeValLike: Sized { #[inline] fn hours(hours: i64) -> Self { - let secs = hours - .checked_mul(SECS_PER_HOUR) + let secs = hours.checked_mul(SECS_PER_HOUR) .expect("TimeValLike::hours ouf of bounds"); Self::seconds(secs) } #[inline] fn minutes(minutes: i64) -> Self { - let secs = minutes - .checked_mul(SECS_PER_MINUTE) + let secs = minutes.checked_mul(SECS_PER_MINUTE) .expect("TimeValLike::minutes out of bounds"); Self::seconds(secs) } @@ -193,10 +178,10 @@ const SECS_PER_MINUTE: i64 = 60; const SECS_PER_HOUR: i64 = 3600; #[cfg(target_pointer_width = "64")] -const TS_MAX_SECONDS: i64 = (i64::MAX / NANOS_PER_SEC) - 1; +const TS_MAX_SECONDS: i64 = (::std::i64::MAX / NANOS_PER_SEC) - 1; #[cfg(target_pointer_width = "32")] -const TS_MAX_SECONDS: i64 = isize::MAX as i64; +const TS_MAX_SECONDS: i64 = ::std::isize::MAX as i64; const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; @@ -258,23 +243,15 @@ impl PartialOrd for TimeSpec { impl TimeValLike for TimeSpec { #[inline] fn seconds(seconds: i64) -> TimeSpec { - assert!( - (TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&seconds), - "TimeSpec out of bounds; seconds={}", - seconds - ); - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 - TimeSpec(timespec { - tv_sec: seconds as time_t, - tv_nsec: 0, - }) + assert!(seconds >= TS_MIN_SECONDS && seconds <= TS_MAX_SECONDS, + "TimeSpec out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: seconds as time_t, tv_nsec: 0 }) } #[inline] fn milliseconds(milliseconds: i64) -> TimeSpec { - let nanoseconds = milliseconds - .checked_mul(1_000_000) + let nanoseconds = milliseconds.checked_mul(1_000_000) .expect("TimeSpec::milliseconds out of bounds"); TimeSpec::nanoseconds(nanoseconds) @@ -283,8 +260,7 @@ impl TimeValLike for TimeSpec { /// Makes a new `TimeSpec` with given number of microseconds. #[inline] fn microseconds(microseconds: i64) -> TimeSpec { - let nanoseconds = microseconds - .checked_mul(1_000) + let nanoseconds = microseconds.checked_mul(1_000) .expect("TimeSpec::milliseconds out of bounds"); TimeSpec::nanoseconds(nanoseconds) @@ -294,16 +270,11 @@ impl TimeValLike for TimeSpec { #[inline] fn nanoseconds(nanoseconds: i64) -> TimeSpec { let (secs, nanos) = div_mod_floor_64(nanoseconds, NANOS_PER_SEC); - assert!( - (TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&secs), - "TimeSpec out of bounds" - ); - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 - TimeSpec(timespec { - tv_sec: secs as time_t, - tv_nsec: nanos as timespec_tv_nsec_t, - }) + assert!(secs >= TS_MIN_SECONDS && secs <= TS_MAX_SECONDS, + "TimeSpec out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: secs as time_t, + tv_nsec: nanos as timespec_tv_nsec_t }) } fn num_seconds(&self) -> i64 { @@ -330,15 +301,6 @@ impl TimeValLike for TimeSpec { } impl TimeSpec { - /// Construct a new `TimeSpec` from its components - #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 - pub const fn new(seconds: time_t, nanoseconds: timespec_tv_nsec_t) -> Self { - Self(timespec { - tv_sec: seconds, - tv_nsec: nanoseconds, - }) - } - fn nanos_mod_sec(&self) -> timespec_tv_nsec_t { if self.tv_sec() < 0 && self.tv_nsec() > 0 { self.tv_nsec() - NANOS_PER_SEC as timespec_tv_nsec_t @@ -357,11 +319,10 @@ impl TimeSpec { } pub const fn from_duration(duration: Duration) -> Self { - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 TimeSpec(timespec { tv_sec: duration.as_secs() as time_t, - tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t, + tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t }) } @@ -382,7 +343,8 @@ impl ops::Add for TimeSpec { type Output = TimeSpec; fn add(self, rhs: TimeSpec) -> TimeSpec { - TimeSpec::nanoseconds(self.num_nanoseconds() + rhs.num_nanoseconds()) + TimeSpec::nanoseconds( + self.num_nanoseconds() + rhs.num_nanoseconds()) } } @@ -390,7 +352,8 @@ impl ops::Sub for TimeSpec { type Output = TimeSpec; fn sub(self, rhs: TimeSpec) -> TimeSpec { - TimeSpec::nanoseconds(self.num_nanoseconds() - rhs.num_nanoseconds()) + TimeSpec::nanoseconds( + self.num_nanoseconds() - rhs.num_nanoseconds()) } } @@ -398,9 +361,7 @@ impl ops::Mul for TimeSpec { type Output = TimeSpec; fn mul(self, rhs: i32) -> TimeSpec { - let usec = self - .num_nanoseconds() - .checked_mul(i64::from(rhs)) + let usec = self.num_nanoseconds().checked_mul(i64::from(rhs)) .expect("TimeSpec multiply out of bounds"); TimeSpec::nanoseconds(usec) @@ -446,6 +407,8 @@ impl fmt::Display for TimeSpec { } } + + #[repr(transparent)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct TimeVal(timeval); @@ -453,10 +416,10 @@ pub struct TimeVal(timeval); const MICROS_PER_SEC: i64 = 1_000_000; #[cfg(target_pointer_width = "64")] -const TV_MAX_SECONDS: i64 = (i64::MAX / MICROS_PER_SEC) - 1; +const TV_MAX_SECONDS: i64 = (::std::i64::MAX / MICROS_PER_SEC) - 1; #[cfg(target_pointer_width = "32")] -const TV_MAX_SECONDS: i64 = isize::MAX as i64; +const TV_MAX_SECONDS: i64 = ::std::isize::MAX as i64; const TV_MIN_SECONDS: i64 = -TV_MAX_SECONDS; @@ -493,23 +456,15 @@ impl PartialOrd for TimeVal { impl TimeValLike for TimeVal { #[inline] fn seconds(seconds: i64) -> TimeVal { - assert!( - (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&seconds), - "TimeVal out of bounds; seconds={}", - seconds - ); - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 - TimeVal(timeval { - tv_sec: seconds as time_t, - tv_usec: 0, - }) + assert!(seconds >= TV_MIN_SECONDS && seconds <= TV_MAX_SECONDS, + "TimeVal out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: seconds as time_t, tv_usec: 0 }) } #[inline] fn milliseconds(milliseconds: i64) -> TimeVal { - let microseconds = milliseconds - .checked_mul(1_000) + let microseconds = milliseconds.checked_mul(1_000) .expect("TimeVal::milliseconds out of bounds"); TimeVal::microseconds(microseconds) @@ -519,16 +474,11 @@ impl TimeValLike for TimeVal { #[inline] fn microseconds(microseconds: i64) -> TimeVal { let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); - assert!( - (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), - "TimeVal out of bounds" - ); - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 - TimeVal(timeval { - tv_sec: secs as time_t, - tv_usec: micros as suseconds_t, - }) + assert!(secs >= TV_MIN_SECONDS && secs <= TV_MAX_SECONDS, + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) } /// Makes a new `TimeVal` with given number of nanoseconds. Some precision @@ -537,16 +487,11 @@ impl TimeValLike for TimeVal { fn nanoseconds(nanoseconds: i64) -> TimeVal { let microseconds = nanoseconds / 1000; let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); - assert!( - (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), - "TimeVal out of bounds" - ); - #[cfg_attr(target_env = "musl", allow(deprecated))] - // https://github.com/rust-lang/libc/issues/1848 - TimeVal(timeval { - tv_sec: secs as time_t, - tv_usec: micros as suseconds_t, - }) + assert!(secs >= TV_MIN_SECONDS && secs <= TV_MAX_SECONDS, + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) } fn num_seconds(&self) -> i64 { @@ -573,15 +518,6 @@ impl TimeValLike for TimeVal { } impl TimeVal { - /// Construct a new `TimeVal` from its components - #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 - pub const fn new(seconds: time_t, microseconds: suseconds_t) -> Self { - Self(timeval { - tv_sec: seconds, - tv_usec: microseconds, - }) - } - fn micros_mod_sec(&self) -> suseconds_t { if self.tv_sec() < 0 && self.tv_usec() > 0 { self.tv_usec() - MICROS_PER_SEC as suseconds_t @@ -612,7 +548,8 @@ impl ops::Add for TimeVal { type Output = TimeVal; fn add(self, rhs: TimeVal) -> TimeVal { - TimeVal::microseconds(self.num_microseconds() + rhs.num_microseconds()) + TimeVal::microseconds( + self.num_microseconds() + rhs.num_microseconds()) } } @@ -620,7 +557,8 @@ impl ops::Sub for TimeVal { type Output = TimeVal; fn sub(self, rhs: TimeVal) -> TimeVal { - TimeVal::microseconds(self.num_microseconds() - rhs.num_microseconds()) + TimeVal::microseconds( + self.num_microseconds() - rhs.num_microseconds()) } } @@ -628,9 +566,7 @@ impl ops::Mul for TimeVal { type Output = TimeVal; fn mul(self, rhs: i32) -> TimeVal { - let usec = self - .num_microseconds() - .checked_mul(i64::from(rhs)) + let usec = self.num_microseconds().checked_mul(i64::from(rhs)) .expect("TimeVal multiply out of bounds"); TimeVal::microseconds(usec) @@ -688,16 +624,18 @@ fn div_mod_floor_64(this: i64, other: i64) -> (i64, i64) { #[inline] fn div_floor_64(this: i64, other: i64) -> i64 { match div_rem_64(this, other) { - (d, r) if (r > 0 && other < 0) || (r < 0 && other > 0) => d - 1, - (d, _) => d, + (d, r) if (r > 0 && other < 0) + || (r < 0 && other > 0) => d - 1, + (d, _) => d, } } #[inline] fn mod_floor_64(this: i64, other: i64) -> i64 { match this % other { - r if (r > 0 && other < 0) || (r < 0 && other > 0) => r + other, - r => r, + r if (r > 0 && other < 0) + || (r < 0 && other > 0) => r + other, + r => r, } } @@ -713,15 +651,11 @@ mod test { #[test] pub fn test_timespec() { - assert_ne!(TimeSpec::seconds(1), TimeSpec::zero()); - assert_eq!( - TimeSpec::seconds(1) + TimeSpec::seconds(2), - TimeSpec::seconds(3) - ); - assert_eq!( - TimeSpec::minutes(3) + TimeSpec::seconds(2), - TimeSpec::seconds(182) - ); + assert!(TimeSpec::seconds(1) != TimeSpec::zero()); + assert_eq!(TimeSpec::seconds(1) + TimeSpec::seconds(2), + TimeSpec::seconds(3)); + assert_eq!(TimeSpec::minutes(3) + TimeSpec::seconds(2), + TimeSpec::seconds(182)); } #[test] @@ -743,7 +677,7 @@ mod test { #[test] pub fn test_timespec_ord() { - assert_eq!(TimeSpec::seconds(1), TimeSpec::nanoseconds(1_000_000_000)); + assert!(TimeSpec::seconds(1) == TimeSpec::nanoseconds(1_000_000_000)); assert!(TimeSpec::seconds(1) < TimeSpec::nanoseconds(1_000_000_001)); assert!(TimeSpec::seconds(1) > TimeSpec::nanoseconds(999_999_999)); assert!(TimeSpec::seconds(-1) < TimeSpec::nanoseconds(-999_999_999)); @@ -756,29 +690,22 @@ mod test { assert_eq!(TimeSpec::seconds(42).to_string(), "42 seconds"); assert_eq!(TimeSpec::milliseconds(42).to_string(), "0.042 seconds"); assert_eq!(TimeSpec::microseconds(42).to_string(), "0.000042 seconds"); - assert_eq!( - TimeSpec::nanoseconds(42).to_string(), - "0.000000042 seconds" - ); + assert_eq!(TimeSpec::nanoseconds(42).to_string(), "0.000000042 seconds"); assert_eq!(TimeSpec::seconds(-86401).to_string(), "-86401 seconds"); } #[test] pub fn test_timeval() { - assert_ne!(TimeVal::seconds(1), TimeVal::zero()); - assert_eq!( - TimeVal::seconds(1) + TimeVal::seconds(2), - TimeVal::seconds(3) - ); - assert_eq!( - TimeVal::minutes(3) + TimeVal::seconds(2), - TimeVal::seconds(182) - ); + assert!(TimeVal::seconds(1) != TimeVal::zero()); + assert_eq!(TimeVal::seconds(1) + TimeVal::seconds(2), + TimeVal::seconds(3)); + assert_eq!(TimeVal::minutes(3) + TimeVal::seconds(2), + TimeVal::seconds(182)); } #[test] pub fn test_timeval_ord() { - assert_eq!(TimeVal::seconds(1), TimeVal::microseconds(1_000_000)); + assert!(TimeVal::seconds(1) == TimeVal::microseconds(1_000_000)); assert!(TimeVal::seconds(1) < TimeVal::microseconds(1_000_001)); assert!(TimeVal::seconds(1) > TimeVal::microseconds(999_999)); assert!(TimeVal::seconds(-1) < TimeVal::microseconds(-999_999)); diff --git a/bash-5.1/vendor/nix/src/sys/timer.rs b/bash-5.1/vendor/nix/src/sys/timer.rs index 45ce0e5bf6b34998f2dfb99678744059572beb3f..349346bb10797572ba161b4464d120f6d85aed3e 100644 --- a/bash-5.1/vendor/nix/src/sys/timer.rs +++ b/bash-5.1/vendor/nix/src/sys/timer.rs @@ -70,7 +70,6 @@ pub struct Timer(libc::timer_t); impl Timer { /// Creates a new timer based on the clock defined by `clockid`. The details /// of the signal and its handler are defined by the passed `sigevent`. - #[cfg_attr(has_doc_alias, doc(alias("timer_create")))] pub fn new(clockid: ClockId, mut sigevent: SigEvent) -> Result { let mut timer_id: mem::MaybeUninit = mem::MaybeUninit::uninit(); Errno::result(unsafe { @@ -123,7 +122,6 @@ impl Timer { /// /// Note: Setting a one shot alarm with a 0s TimeSpec disable the alarm /// altogether. - #[cfg_attr(has_doc_alias, doc(alias("timer_settime")))] pub fn set(&mut self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { let timerspec: TimerSpec = expiration.into(); Errno::result(unsafe { @@ -138,7 +136,6 @@ impl Timer { } /// Get the parameters for the alarm currently set, if any. - #[cfg_attr(has_doc_alias, doc(alias("timer_gettime")))] pub fn get(&self) -> Result> { let mut timerspec = TimerSpec::none(); Errno::result(unsafe { libc::timer_gettime(self.0, timerspec.as_mut()) }).map(|_| { @@ -161,7 +158,6 @@ impl Timer { /// 'overrun'. This function returns how many times that has happened to /// this timer, up to `libc::DELAYTIMER_MAX`. If more than the maximum /// number of overruns have happened the return is capped to the maximum. - #[cfg_attr(has_doc_alias, doc(alias("timer_getoverrun")))] pub fn overruns(&self) -> i32 { unsafe { libc::timer_getoverrun(self.0) } } diff --git a/bash-5.1/vendor/nix/src/sys/timerfd.rs b/bash-5.1/vendor/nix/src/sys/timerfd.rs index 42860658aa5fbf6dd50bea3780a8593223fb72d7..18acbae30b1593808b2bca09a69b60ccaf270e98 100644 --- a/bash-5.1/vendor/nix/src/sys/timerfd.rs +++ b/bash-5.1/vendor/nix/src/sys/timerfd.rs @@ -92,7 +92,6 @@ impl TimerFd { /// Creates a new timer based on the clock defined by `clockid`. The /// underlying fd can be assigned specific flags with `flags` (CLOEXEC, /// NONBLOCK). The underlying fd will be closed on drop. - #[cfg_attr(has_doc_alias, doc(alias("timerfd_create")))] pub fn new(clockid: ClockId, flags: TimerFlags) -> Result { Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) }) .map(|fd| Self { fd }) @@ -134,7 +133,6 @@ impl TimerFd { /// /// Note: Setting a one shot alarm with a 0s TimeSpec disables the alarm /// altogether. - #[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))] pub fn set(&self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { let timerspec: TimerSpec = expiration.into(); Errno::result(unsafe { @@ -149,7 +147,6 @@ impl TimerFd { } /// Get the parameters for the alarm currently set, if any. - #[cfg_attr(has_doc_alias, doc(alias("timerfd_gettime")))] pub fn get(&self) -> Result> { let mut timerspec = TimerSpec::none(); Errno::result(unsafe { libc::timerfd_gettime(self.fd, timerspec.as_mut()) }).map(|_| { @@ -166,7 +163,6 @@ impl TimerFd { } /// Remove the alarm if any is set. - #[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))] pub fn unset(&self) -> Result<()> { Errno::result(unsafe { libc::timerfd_settime( diff --git a/bash-5.1/vendor/nix/src/sys/uio.rs b/bash-5.1/vendor/nix/src/sys/uio.rs index 1908973b496e53c7d95322ee1e21bbf5effca269..ba6c64ef260ab75b08835b2eb6b9c8a29c7d36ee 100644 --- a/bash-5.1/vendor/nix/src/sys/uio.rs +++ b/bash-5.1/vendor/nix/src/sys/uio.rs @@ -39,7 +39,7 @@ pub fn readv(fd: RawFd, iov: &mut [IoSliceMut<'_>]) -> Result { /// or an error occurs. The file offset is not changed. /// /// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html) -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] pub fn pwritev(fd: RawFd, iov: &[IoSlice<'_>], offset: off_t) -> Result { @@ -62,7 +62,7 @@ pub fn pwritev(fd: RawFd, iov: &[IoSlice<'_>], /// changed. /// /// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html) -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] pub fn preadv(fd: RawFd, iov: &mut [IoSliceMut<'_>], offset: off_t) -> Result { @@ -132,10 +132,6 @@ pub struct RemoteIoVec { note = "`IoVec` is no longer used in the public interface, use `IoSlice` or `IoSliceMut` instead" )] #[repr(transparent)] -#[allow(renamed_and_removed_lints)] -#[allow(clippy::unknown_clippy_lints)] -// Clippy false positive: https://github.com/rust-lang/rust-clippy/issues/8867 -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct IoVec(pub(crate) libc::iovec, PhantomData); diff --git a/bash-5.1/vendor/nix/src/unistd.rs b/bash-5.1/vendor/nix/src/unistd.rs index 42e1456aabe7336f06c6974e204b3ba18b69251c..764b3dee436a24ac56fdee89800fa96ee13fce31 100644 --- a/bash-5.1/vendor/nix/src/unistd.rs +++ b/bash-5.1/vendor/nix/src/unistd.rs @@ -1,42 +1,28 @@ //! Safe wrappers around functions found in libc "unistd.h" header +#[cfg(not(target_os = "redox"))] +use cfg_if::cfg_if; use crate::errno::{self, Errno}; +use crate::{Error, Result, NixPath}; #[cfg(not(target_os = "redox"))] #[cfg(feature = "fs")] -use crate::fcntl::{at_rawfd, AtFlags}; +use crate::fcntl::{AtFlags, at_rawfd}; +use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t, + uid_t, gid_t, mode_t, PATH_MAX}; #[cfg(feature = "fs")] -use crate::fcntl::{fcntl, FcntlArg::F_SETFD, FdFlag, OFlag}; -#[cfg(all( - feature = "fs", - any( - target_os = "openbsd", - target_os = "netbsd", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "macos", - target_os = "ios" - ) -))] -use crate::sys::stat::FileFlag; -#[cfg(feature = "fs")] -use crate::sys::stat::Mode; -use crate::{Error, NixPath, Result}; -#[cfg(not(target_os = "redox"))] -use cfg_if::cfg_if; -use libc::{ - self, c_char, c_int, c_long, c_uint, c_void, gid_t, mode_t, off_t, pid_t, - size_t, uid_t, PATH_MAX, -}; +use crate::fcntl::{FdFlag, OFlag, fcntl, FcntlArg::F_SETFD}; +use std::{fmt, mem, ptr}; use std::convert::Infallible; use std::ffi::{CStr, OsString}; #[cfg(not(target_os = "redox"))] use std::ffi::{CString, OsStr}; +use std::os::unix::ffi::OsStringExt; #[cfg(not(target_os = "redox"))] use std::os::unix::ffi::OsStrExt; -use std::os::unix::ffi::OsStringExt; use std::os::unix::io::RawFd; use std::path::PathBuf; -use std::{fmt, mem, ptr}; +#[cfg(feature = "fs")] +use crate::sys::stat::Mode; feature! { #![feature = "fs"] @@ -44,22 +30,18 @@ feature! { pub use self::pivot_root::*; } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] pub use self::setres::*; -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] pub use self::getres::*; feature! { @@ -79,13 +61,11 @@ impl Uid { } /// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`. - #[cfg_attr(has_doc_alias, doc(alias("getuid")))] pub fn current() -> Self { getuid() } /// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`. - #[cfg_attr(has_doc_alias, doc(alias("geteuid")))] pub fn effective() -> Self { geteuid() } @@ -107,12 +87,6 @@ impl From for uid_t { } } -impl From for Uid { - fn from(uid: uid_t) -> Self { - Uid(uid) - } -} - impl fmt::Display for Uid { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.0, f) @@ -136,13 +110,11 @@ impl Gid { } /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`. - #[cfg_attr(has_doc_alias, doc(alias("getgid")))] pub fn current() -> Self { getgid() } /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`. - #[cfg_attr(has_doc_alias, doc(alias("getegid")))] pub fn effective() -> Self { getegid() } @@ -159,12 +131,6 @@ impl From for gid_t { } } -impl From for Gid { - fn from(gid: gid_t) -> Self { - Gid(gid) - } -} - impl fmt::Display for Gid { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.0, f) @@ -188,13 +154,11 @@ impl Pid { } /// Returns PID of calling process - #[cfg_attr(has_doc_alias, doc(alias("getpid")))] pub fn this() -> Self { getpid() } /// Returns PID of parent of calling process - #[cfg_attr(has_doc_alias, doc(alias("getppid")))] pub fn parent() -> Self { getppid() } @@ -585,7 +549,7 @@ pub fn mkfifo(path: &P, mode: Mode) -> Result<()> { // mkfifoat is not implemented in OSX or android #[inline] #[cfg(not(any( - target_os = "macos", target_os = "ios", target_os = "haiku", + target_os = "macos", target_os = "ios", target_os = "android", target_os = "redox")))] pub fn mkfifoat(dirfd: Option, path: &P, mode: Mode) -> Result<()> { let res = path.with_nix_path(|cstr| unsafe { @@ -632,7 +596,7 @@ fn reserve_double_buffer_size(buf: &mut Vec, limit: usize) -> Result<()> { use std::cmp::min; if buf.capacity() >= limit { - return Err(Errno::ERANGE); + return Err(Errno::ERANGE) } let capacity = min(buf.capacity() * 2, limit); @@ -758,8 +722,8 @@ pub enum FchownatFlags { /// If `flag` is `FchownatFlags::NoFollowSymlink` and `path` names a symbolic link, /// then the mode of the symbolic link is changed. /// -/// `fchownat(None, path, owner, group, FchownatFlags::NoFollowSymlink)` is identical to -/// a call `libc::lchown(path, owner, group)`. That's why `lchown` is unimplemented in +/// `fchownat(None, path, mode, FchownatFlags::NoFollowSymlink)` is identical to +/// a call `libc::lchown(path, mode)`. That's why `lchmod` is unimplemented in /// the `nix` crate. /// /// # References @@ -1003,34 +967,34 @@ pub fn sethostname>(name: S) -> Result<()> { Errno::result(res).map(drop) } -/// Get the host name and store it in an internally allocated buffer, returning an -/// `OsString` on success (see +/// Get the host name and store it in the provided buffer, returning a pointer +/// the `CStr` in that buffer on success (see /// [gethostname(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html)). /// /// This function call attempts to get the host name for the running system and -/// store it in an internal buffer, returning it as an `OsString` if successful. +/// store it in a provided buffer. The buffer will be populated with bytes up +/// to the length of the provided slice including a NUL terminating byte. If +/// the hostname is longer than the length provided, no error will be provided. +/// The posix specification does not specify whether implementations will +/// null-terminate in this case, but the nix implementation will ensure that the +/// buffer is null terminated in this case. /// /// ```no_run /// use nix::unistd; /// -/// let hostname = unistd::gethostname().expect("Failed getting hostname"); -/// let hostname = hostname.into_string().expect("Hostname wasn't valid UTF-8"); +/// let mut buf = [0u8; 64]; +/// let hostname_cstr = unistd::gethostname(&mut buf).expect("Failed getting hostname"); +/// let hostname = hostname_cstr.to_str().expect("Hostname wasn't valid UTF-8"); /// println!("Hostname: {}", hostname); /// ``` -pub fn gethostname() -> Result { - // The capacity is the max length of a hostname plus the NUL terminator. - let mut buffer: Vec = Vec::with_capacity(256); +pub fn gethostname(buffer: &mut [u8]) -> Result<&CStr> { let ptr = buffer.as_mut_ptr() as *mut c_char; - let len = buffer.capacity() as size_t; + let len = buffer.len() as size_t; let res = unsafe { libc::gethostname(ptr, len) }; Errno::result(res).map(|_| { - unsafe { - buffer.as_mut_ptr().wrapping_add(len - 1).write(0); // ensure always null-terminated - let len = CStr::from_ptr(buffer.as_ptr() as *const c_char).len(); - buffer.set_len(len); - } - OsString::from_vec(buffer) + buffer[len - 1] = 0; // ensure always null-terminated + unsafe { CStr::from_ptr(buffer.as_ptr() as *const c_char) } }) } } @@ -1069,9 +1033,7 @@ pub fn close(fd: RawFd) -> Result<()> { /// /// See also [read(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html) pub fn read(fd: RawFd, buf: &mut [u8]) -> Result { - let res = unsafe { - libc::read(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t) - }; + let res = unsafe { libc::read(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t) }; Errno::result(res).map(|r| r as usize) } @@ -1080,9 +1042,7 @@ pub fn read(fd: RawFd, buf: &mut [u8]) -> Result { /// /// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html) pub fn write(fd: RawFd, buf: &[u8]) -> Result { - let res = unsafe { - libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t) - }; + let res = unsafe { libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t) }; Errno::result(res).map(|r| r as usize) } @@ -1146,13 +1106,15 @@ pub fn lseek64(fd: RawFd, offset: libc::off64_t, whence: Whence) -> Result std::result::Result<(RawFd, RawFd), Error> { - let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + unsafe { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); - let res = unsafe { libc::pipe(fds.as_mut_ptr() as *mut c_int) }; + let res = libc::pipe(fds.as_mut_ptr() as *mut c_int); - Error::result(res)?; + Error::result(res)?; - unsafe { Ok((fds.assume_init()[0], fds.assume_init()[1])) } + Ok((fds.assume_init()[0], fds.assume_init()[1])) + } } feature! { @@ -1572,7 +1534,7 @@ pub fn getgroups() -> Result> { /// # use std::error::Error; /// # use nix::unistd::*; /// # -/// # fn try_main() -> Result<(), Box> { +/// # fn try_main() -> Result<(), Box> { /// let uid = Uid::from_raw(33); /// let gid = Gid::from_raw(34); /// setgroups(&[gid])?; @@ -1584,7 +1546,7 @@ pub fn getgroups() -> Result> { /// # /// # try_main().unwrap(); /// ``` -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] pub fn setgroups(groups: &[Gid]) -> Result<()> { cfg_if! { if #[cfg(any(target_os = "dragonfly", @@ -1698,7 +1660,7 @@ pub fn getgrouplist(user: &CStr, group: Gid) -> Result> { /// # use std::ffi::CString; /// # use nix::unistd::*; /// # -/// # fn try_main() -> Result<(), Box> { +/// # fn try_main() -> Result<(), Box> { /// let user = CString::new("www-data").unwrap(); /// let uid = Uid::from_raw(33); /// let gid = Gid::from_raw(33); @@ -1711,7 +1673,7 @@ pub fn getgrouplist(user: &CStr, group: Gid) -> Result> { /// # /// # try_main().unwrap(); /// ``` -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { cfg_if! { if #[cfg(any(target_os = "ios", target_os = "macos"))] { @@ -1840,7 +1802,7 @@ pub fn sleep(seconds: c_uint) -> c_uint { feature! { #![feature = "acct"] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] pub mod acct { use crate::{Result, NixPath}; use crate::errno::Errno; @@ -2126,12 +2088,12 @@ feature! { pub enum SysconfVar { /// Maximum number of I/O operations in a single list I/O call supported by /// the implementation. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] AIO_LISTIO_MAX = libc::_SC_AIO_LISTIO_MAX, /// Maximum number of outstanding asynchronous I/O operations supported by /// the implementation. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] AIO_MAX = libc::_SC_AIO_MAX, #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", @@ -2148,19 +2110,19 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] ATEXIT_MAX = libc::_SC_ATEXIT_MAX, /// Maximum obase values allowed by the bc utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] BC_BASE_MAX = libc::_SC_BC_BASE_MAX, /// Maximum number of elements permitted in an array by the bc utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] BC_DIM_MAX = libc::_SC_BC_DIM_MAX, /// Maximum scale value allowed by the bc utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] BC_SCALE_MAX = libc::_SC_BC_SCALE_MAX, /// Maximum length of a string constant accepted by the bc utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] BC_STRING_MAX = libc::_SC_BC_STRING_MAX, /// Maximum number of simultaneous processes per real user ID. @@ -2169,16 +2131,16 @@ pub enum SysconfVar { CLK_TCK = libc::_SC_CLK_TCK, /// Maximum number of weights that can be assigned to an entry of the /// LC_COLLATE order keyword in the locale definition file - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] COLL_WEIGHTS_MAX = libc::_SC_COLL_WEIGHTS_MAX, /// Maximum number of timer expiration overruns. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] DELAYTIMER_MAX = libc::_SC_DELAYTIMER_MAX, /// Maximum number of expressions that can be nested within parentheses by /// the expr utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] EXPR_NEST_MAX = libc::_SC_EXPR_NEST_MAX, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", @@ -2197,11 +2159,10 @@ pub enum SysconfVar { /// input line (either standard input or another file), when the utility is /// described as processing text files. The length includes room for the /// trailing . - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] LINE_MAX = libc::_SC_LINE_MAX, /// Maximum length of a login name. - #[cfg(not(target_os = "haiku"))] LOGIN_NAME_MAX = libc::_SC_LOGIN_NAME_MAX, /// Maximum number of simultaneous supplementary group IDs per process. NGROUPS_MAX = libc::_SC_NGROUPS_MAX, @@ -2214,11 +2175,11 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] GETPW_R_SIZE_MAX = libc::_SC_GETPW_R_SIZE_MAX, /// The maximum number of open message queue descriptors a process may hold. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] MQ_OPEN_MAX = libc::_SC_MQ_OPEN_MAX, /// The maximum number of message priorities supported by the implementation. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] MQ_PRIO_MAX = libc::_SC_MQ_PRIO_MAX, /// A value one greater than the maximum value that the system may assign to @@ -2236,7 +2197,7 @@ pub enum SysconfVar { /// The implementation supports barriers. _POSIX_BARRIERS = libc::_SC_BARRIERS, /// The implementation supports asynchronous input and output. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_ASYNCHRONOUS_IO = libc::_SC_ASYNCHRONOUS_IO, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", @@ -2252,7 +2213,7 @@ pub enum SysconfVar { /// The implementation supports the Process CPU-Time Clocks option. _POSIX_CPUTIME = libc::_SC_CPUTIME, /// The implementation supports the File Synchronization option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_FSYNC = libc::_SC_FSYNC, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", @@ -2266,15 +2227,15 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_JOB_CONTROL = libc::_SC_JOB_CONTROL, /// The implementation supports memory mapped Files. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_MAPPED_FILES = libc::_SC_MAPPED_FILES, /// The implementation supports the Process Memory Locking option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_MEMLOCK = libc::_SC_MEMLOCK, /// The implementation supports the Range Memory Locking option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_MEMLOCK_RANGE = libc::_SC_MEMLOCK_RANGE, /// The implementation supports memory protection. @@ -2282,7 +2243,7 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_MEMORY_PROTECTION = libc::_SC_MEMORY_PROTECTION, /// The implementation supports the Message Passing option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_MESSAGE_PASSING = libc::_SC_MESSAGE_PASSING, /// The implementation supports the Monotonic Clock option. @@ -2296,7 +2257,7 @@ pub enum SysconfVar { /// The implementation supports the Prioritized Input and Output option. _POSIX_PRIORITIZED_IO = libc::_SC_PRIORITIZED_IO, /// The implementation supports the Process Scheduling option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_PRIORITY_SCHEDULING = libc::_SC_PRIORITY_SCHEDULING, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", @@ -2332,7 +2293,7 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_SEMAPHORES = libc::_SC_SEMAPHORES, /// The implementation supports the Shared Memory Objects option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_SHARED_MEMORY_OBJECTS = libc::_SC_SHARED_MEMORY_OBJECTS, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", @@ -2363,7 +2324,7 @@ pub enum SysconfVar { #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_SS_REPL_MAX = libc::_SC_SS_REPL_MAX, /// The implementation supports the Synchronized Input and Output option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_SYNCHRONIZED_IO = libc::_SC_SYNCHRONIZED_IO, /// The implementation supports the Thread Stack Address Attribute option. @@ -2381,11 +2342,11 @@ pub enum SysconfVar { _POSIX_THREAD_CPUTIME = libc::_SC_THREAD_CPUTIME, /// The implementation supports the Non-Robust Mutex Priority Inheritance /// option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_THREAD_PRIO_INHERIT = libc::_SC_THREAD_PRIO_INHERIT, /// The implementation supports the Non-Robust Mutex Priority Protection option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_THREAD_PRIO_PROTECT = libc::_SC_THREAD_PRIO_PROTECT, /// The implementation supports the Thread Execution Scheduling option. @@ -2408,7 +2369,7 @@ pub enum SysconfVar { /// The implementation supports the Robust Mutex Priority Protection option. _POSIX_THREAD_ROBUST_PRIO_PROTECT = libc::_SC_THREAD_ROBUST_PRIO_PROTECT, /// The implementation supports thread-safe functions. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX_THREAD_SAFE_FUNCTIONS = libc::_SC_THREAD_SAFE_FUNCTIONS, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", @@ -2505,28 +2466,28 @@ pub enum SysconfVar { /// using at least 64 bits. _POSIX_V6_LPBIG_OFFBIG = libc::_SC_V6_LPBIG_OFFBIG, /// The implementation supports the C-Language Binding option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_C_BIND = libc::_SC_2_C_BIND, /// The implementation supports the C-Language Development Utilities option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_C_DEV = libc::_SC_2_C_DEV, /// The implementation supports the Terminal Characteristics option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_CHAR_TERM = libc::_SC_2_CHAR_TERM, /// The implementation supports the FORTRAN Development Utilities option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_FORT_DEV = libc::_SC_2_FORT_DEV, /// The implementation supports the FORTRAN Runtime Utilities option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_FORT_RUN = libc::_SC_2_FORT_RUN, /// The implementation supports the creation of locales by the localedef /// utility. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_LOCALEDEF = libc::_SC_2_LOCALEDEF, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", @@ -2567,16 +2528,16 @@ pub enum SysconfVar { /// The implementation supports the Track Batch Job Request option. _POSIX2_PBS_TRACK = libc::_SC_2_PBS_TRACK, /// The implementation supports the Software Development Utilities option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_SW_DEV = libc::_SC_2_SW_DEV, /// The implementation supports the User Portability Utilities option. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_UPE = libc::_SC_2_UPE, /// Integer value indicating version of the Shell and Utilities volume of /// POSIX.1 to which the implementation conforms. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _POSIX2_VERSION = libc::_SC_2_VERSION, /// The size of a system page in bytes. @@ -2584,19 +2545,18 @@ pub enum SysconfVar { /// POSIX also defines an alias named `PAGESIZE`, but Rust does not allow two /// enum constants to have the same value, so nix omits `PAGESIZE`. PAGE_SIZE = libc::_SC_PAGE_SIZE, - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] PTHREAD_DESTRUCTOR_ITERATIONS = libc::_SC_THREAD_DESTRUCTOR_ITERATIONS, - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] PTHREAD_KEYS_MAX = libc::_SC_THREAD_KEYS_MAX, #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] PTHREAD_STACK_MIN = libc::_SC_THREAD_STACK_MIN, - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] PTHREAD_THREADS_MAX = libc::_SC_THREAD_THREADS_MAX, - #[cfg(not(target_os = "haiku"))] RE_DUP_MAX = libc::_SC_RE_DUP_MAX, #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", target_os = "ios", target_os="linux", target_os = "macos", @@ -2659,7 +2619,7 @@ pub enum SysconfVar { _XOPEN_REALTIME_THREADS = libc::_SC_XOPEN_REALTIME_THREADS, /// The implementation supports the Issue 4, Version 2 Shared Memory Option /// Group. - #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg(not(target_os = "redox"))] #[cfg_attr(docsrs, doc(cfg(all())))] _XOPEN_SHM = libc::_SC_XOPEN_SHM, #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", @@ -2680,19 +2640,6 @@ pub enum SysconfVar { /// Integer value indicating version of the X/Open Portability Guide to /// which the implementation conforms. _XOPEN_VERSION = libc::_SC_XOPEN_VERSION, - /// The number of pages of physical memory. Note that it is possible for - /// the product of this value to overflow. - #[cfg(any(target_os="android", target_os="linux"))] - _PHYS_PAGES = libc::_SC_PHYS_PAGES, - /// The number of currently available pages of physical memory. - #[cfg(any(target_os="android", target_os="linux"))] - _AVPHYS_PAGES = libc::_SC_AVPHYS_PAGES, - /// The number of processors configured. - #[cfg(any(target_os="android", target_os="linux"))] - _NPROCESSORS_CONF = libc::_SC_NPROCESSORS_CONF, - /// The number of processors currently online (available). - #[cfg(any(target_os="android", target_os="linux"))] - _NPROCESSORS_ONLN = libc::_SC_NPROCESSORS_ONLN, } /// Get configurable system variables (see @@ -2751,13 +2698,11 @@ mod pivot_root { } } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] mod setres { feature! { #![feature = "user"] @@ -2800,13 +2745,11 @@ mod setres { } } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] mod getres { feature! { #![feature = "user"] @@ -2872,7 +2815,7 @@ mod getres { } #[cfg(feature = "fs")] -libc_bitflags! { +libc_bitflags!{ /// Options for access() #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] pub struct AccessFlags : c_int { @@ -2900,27 +2843,6 @@ pub fn access(path: &P, amode: AccessFlags) -> Result<()> { })?; Errno::result(res).map(drop) } - -/// Checks the file named by `path` for accessibility according to the flags given by `mode` -/// -/// If `dirfd` has a value, then `path` is relative to directory associated with the file descriptor. -/// -/// If `dirfd` is `None`, then `path` is relative to the current working directory. -/// -/// # References -/// -/// [faccessat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html) -// illumos: faccessat(2) appears to be supported, but the libc crate does not provide a binding. -// redox: does not appear to support the *at family of syscalls. -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] -pub fn faccessat(dirfd: Option, path: &P, mode: AccessFlags, flags: AtFlags) -> Result<()> { - let res = path.with_nix_path(|cstr| { - unsafe { - libc::faccessat(at_rawfd(dirfd), cstr.as_ptr(), mode.bits(), flags.bits()) - } - })?; - Errno::result(res).map(drop) -} } feature! { @@ -2933,11 +2855,11 @@ feature! { /// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only /// contains ASCII. #[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd -#[derive(Debug, Clone, Eq, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct User { /// Username pub name: String, - /// User password (probably hashed) + /// User password (probably encrypted) pub passwd: CString, /// User ID pub uid: Uid, @@ -2953,7 +2875,6 @@ pub struct User { /// Login class #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] @@ -2962,7 +2883,6 @@ pub struct User { /// Last password change #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] @@ -2971,7 +2891,6 @@ pub struct User { /// Expiration time of account #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] @@ -2979,40 +2898,37 @@ pub struct User { pub expire: libc::time_t } -#[cfg(not(target_os = "redox"))] //RedoxFS does not support passwd +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd impl From<&libc::passwd> for User { fn from(pw: &libc::passwd) -> User { unsafe { User { - name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(), - passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(), + name: CStr::from_ptr((*pw).pw_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr((*pw).pw_passwd).to_bytes()).unwrap(), #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] - gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(), - dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())), - shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())), - uid: Uid::from_raw(pw.pw_uid), - gid: Gid::from_raw(pw.pw_gid), + gecos: CString::new(CStr::from_ptr((*pw).pw_gecos).to_bytes()).unwrap(), + dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_dir).to_bytes())), + shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_shell).to_bytes())), + uid: Uid::from_raw((*pw).pw_uid), + gid: Gid::from_raw((*pw).pw_gid), #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] - class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes()).unwrap(), + class: CString::new(CStr::from_ptr((*pw).pw_class).to_bytes()).unwrap(), #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] - change: pw.pw_change, + change: (*pw).pw_change, #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] - expire: pw.pw_expire + expire: (*pw).pw_expire } } } @@ -3044,21 +2960,18 @@ impl From for libc::passwd { pw_gid: u.gid.0, #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] pw_class: u.class.into_raw(), #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] pw_change: u.change, #[cfg(not(any(target_os = "android", target_os = "fuchsia", - target_os = "haiku", target_os = "illumos", target_os = "linux", target_os = "solaris")))] @@ -3121,7 +3034,7 @@ impl User { /// use nix::unistd::{Uid, User}; /// // Returns an Result>, thus the double unwrap. /// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap(); - /// assert_eq!(res.name, "root"); + /// assert!(res.name == "root"); /// ``` pub fn from_uid(uid: Uid) -> Result> { User::from_anything(|pwd, cbuf, cap, res| { @@ -3140,7 +3053,7 @@ impl User { /// use nix::unistd::User; /// // Returns an Result>, thus the double unwrap. /// let res = User::from_name("root").unwrap().unwrap(); - /// assert_eq!(res.name, "root"); + /// assert!(res.name == "root"); /// ``` pub fn from_name(name: &str) -> Result> { let name = CString::new(name).unwrap(); @@ -3152,7 +3065,7 @@ impl User { /// Representation of a Group, based on `libc::group` #[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd -#[derive(Debug, Clone, Eq, PartialEq)] +#[derive(Debug, Clone, PartialEq)] pub struct Group { /// Group name pub name: String, @@ -3169,10 +3082,10 @@ impl From<&libc::group> for Group { fn from(gr: &libc::group) -> Group { unsafe { Group { - name: CStr::from_ptr(gr.gr_name).to_string_lossy().into_owned(), - passwd: CString::new(CStr::from_ptr(gr.gr_passwd).to_bytes()).unwrap(), - gid: Gid::from_raw(gr.gr_gid), - mem: Group::members(gr.gr_mem) + name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(), + gid: Gid::from_raw((*gr).gr_gid), + mem: Group::members((*gr).gr_mem) } } } @@ -3321,26 +3234,3 @@ pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> { Errno::result(ret).map(|_| (Uid(uid), Gid(gid))) } } - -feature! { -#![all(feature = "fs")] - -/// Set the file flags. -/// -/// See also [chflags(2)](https://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=2) -#[cfg(any( - target_os = "openbsd", - target_os = "netbsd", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "macos", - target_os = "ios" -))] -pub fn chflags(path: &P, flags: FileFlag) -> Result<()> { - let res = path.with_nix_path(|cstr| unsafe { - libc::chflags(cstr.as_ptr(), flags.bits()) - })?; - - Errno::result(res).map(drop) -} -} diff --git a/bash-5.1/vendor/nix/test/common/mod.rs b/bash-5.1/vendor/nix/test/common/mod.rs index bb056aab87c5c637e2e1c7bcafe03fc2bf2b8f2a..544a1ae3f0ad4a3d917c5057082df6a5b7f5a8e2 100644 --- a/bash-5.1/vendor/nix/test/common/mod.rs +++ b/bash-5.1/vendor/nix/test/common/mod.rs @@ -1,7 +1,6 @@ use cfg_if::cfg_if; -#[macro_export] -macro_rules! skip { +#[macro_export] macro_rules! skip { ($($reason: expr),+) => { use ::std::io::{self, Write}; @@ -34,49 +33,42 @@ cfg_if! { /// Skip the test if we don't have the ability to mount file systems. #[cfg(target_os = "freebsd")] -#[macro_export] -macro_rules! require_mount { +#[macro_export] macro_rules! require_mount { ($name:expr) => { - use ::sysctl::{CtlValue, Sysctl}; + use ::sysctl::CtlValue; use nix::unistd::Uid; - let ctl = ::sysctl::Ctl::new("vfs.usermount").unwrap(); - if !Uid::current().is_root() && CtlValue::Int(0) == ctl.value().unwrap() + if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() { - skip!( - "{} requires the ability to mount file systems. Skipping test.", - $name - ); + skip!("{} requires the ability to mount file systems. Skipping test.", $name); } - }; + } } -#[cfg(any(target_os = "linux", target_os = "android"))] -#[macro_export] -macro_rules! skip_if_cirrus { +#[cfg(any(target_os = "linux", target_os= "android"))] +#[macro_export] macro_rules! skip_if_cirrus { ($reason:expr) => { if std::env::var_os("CIRRUS_CI").is_some() { skip!("{}", $reason); } - }; + } } #[cfg(target_os = "freebsd")] -#[macro_export] -macro_rules! skip_if_jailed { +#[macro_export] macro_rules! skip_if_jailed { ($name:expr) => { - use ::sysctl::{CtlValue, Sysctl}; + use ::sysctl::CtlValue; - let ctl = ::sysctl::Ctl::new("security.jail.jailed").unwrap(); - if let CtlValue::Int(1) = ctl.value().unwrap() { + if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") + .unwrap() + { skip!("{} cannot run in a jail. Skipping test.", $name); } - }; + } } #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] -#[macro_export] -macro_rules! skip_if_not_root { +#[macro_export] macro_rules! skip_if_not_root { ($name:expr) => { use nix::unistd::Uid; diff --git a/bash-5.1/vendor/nix/test/sys/mod.rs b/bash-5.1/vendor/nix/test/sys/mod.rs index 20312120a68c0e8fdae69dfeb58680f725fb40ca..91c0aae708b03d9fe03d4e270724654b97e05cd2 100644 --- a/bash-5.1/vendor/nix/test/sys/mod.rs +++ b/bash-5.1/vendor/nix/test/sys/mod.rs @@ -5,56 +5,43 @@ mod test_signal; // works or not heavily depends on which pthread implementation is chosen // by the user at link time. For this reason we do not want to run aio test // cases on DragonFly. -#[cfg(any( - target_os = "freebsd", - target_os = "ios", - all(target_os = "linux", not(target_env = "uclibc")), - target_os = "macos", - target_os = "netbsd" -))] +#[cfg(any(target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd"))] mod test_aio; -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] -mod test_ioctl; #[cfg(not(target_os = "redox"))] mod test_mman; -#[cfg(not(target_os = "redox"))] -mod test_select; #[cfg(target_os = "linux")] mod test_signalfd; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] mod test_socket; -#[cfg(not(any(target_os = "redox")))] +#[cfg(not(target_os = "redox"))] mod test_sockopt; -mod test_stat; +#[cfg(not(target_os = "redox"))] +mod test_select; #[cfg(any(target_os = "android", target_os = "linux"))] mod test_sysinfo; -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] mod test_termios; -mod test_uio; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_ioctl; mod test_wait; +mod test_uio; #[cfg(any(target_os = "android", target_os = "linux"))] mod test_epoll; #[cfg(target_os = "linux")] mod test_inotify; mod test_pthread; -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] mod test_ptrace; #[cfg(any(target_os = "android", target_os = "linux"))] mod test_timerfd; diff --git a/bash-5.1/vendor/nix/test/sys/test_aio.rs b/bash-5.1/vendor/nix/test/sys/test_aio.rs index 6a36f3e7cf0cbd759ef82c2923261b2e52d04c94..80cd053f8defadb83b8c8dbf8cf68f4d2a20511d 100644 --- a/bash-5.1/vendor/nix/test/sys/test_aio.rs +++ b/bash-5.1/vendor/nix/test/sys/test_aio.rs @@ -1,516 +1,415 @@ -use std::{ - io::{Read, Seek, SeekFrom, Write}, - ops::Deref, - os::unix::io::AsRawFd, - pin::Pin, - sync::atomic::{AtomicBool, Ordering}, - thread, time, -}; - -use libc::c_int; -use nix::{ - errno::*, - sys::{ - aio::*, - signal::{ - sigaction, SaFlags, SigAction, SigHandler, SigSet, SigevNotify, - Signal, - }, - time::{TimeSpec, TimeValLike}, - }, -}; +use libc::{c_int, c_void}; +use nix::Result; +use nix::errno::*; +use nix::sys::aio::*; +use nix::sys::signal::{SaFlags, SigAction, sigaction, SigevNotify, SigHandler, Signal, SigSet}; +use nix::sys::time::{TimeSpec, TimeValLike}; +use std::io::{Write, Read, Seek, SeekFrom}; +use std::ops::Deref; +use std::os::unix::io::AsRawFd; +use std::pin::Pin; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::{thread, time}; use tempfile::tempfile; -lazy_static! { - pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +// Helper that polls an AioCb for completion or error +fn poll_aio(aiocb: &mut Pin>) -> Result<()> { + loop { + let err = aiocb.error(); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } } -extern "C" fn sigfunc(_: c_int) { - SIGNALED.store(true, Ordering::Relaxed); +// Helper that polls a component of an LioCb for completion or error +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +fn poll_lio(liocb: &mut LioCb, i: usize) -> Result<()> { + loop { + let err = liocb.error(i); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } } -// Helper that polls an AioCb for completion or error -macro_rules! poll_aio { - ($aiocb: expr) => { - loop { - let err = $aiocb.as_mut().error(); - if err != Err(Errno::EINPROGRESS) { - break err; - }; - thread::sleep(time::Duration::from_millis(10)); - } - }; +#[test] +fn test_accessors() { + let mut rbuf = vec![0; 4]; + let aiocb = AioCb::from_mut_slice( 1001, + 2, //offset + &mut rbuf, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99 + }, + LioOpcode::LIO_NOP); + assert_eq!(1001, aiocb.fd()); + assert_eq!(Some(LioOpcode::LIO_NOP), aiocb.lio_opcode()); + assert_eq!(4, aiocb.nbytes()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); } -mod aio_fsync { - use super::*; - - #[test] - fn test_accessors() { - let aiocb = AioFsync::new( - 1001, - AioFsyncMode::O_SYNC, - 42, - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 99, - }, - ); - assert_eq!(1001, aiocb.fd()); - assert_eq!(AioFsyncMode::O_SYNC, aiocb.mode()); - assert_eq!(42, aiocb.priority()); - let sev = aiocb.sigevent().sigevent(); - assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); - assert_eq!(99, sev.sigev_value.sival_ptr as i64); - } +// Tests AioCb.cancel. We aren't trying to test the OS's implementation, only +// our bindings. So it's sufficient to check that AioCb.cancel returned any +// AioCancelStat value. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_cancel() { + let wbuf: &[u8] = b"CDEF"; - /// `AioFsync::submit` should not modify the `AioCb` object if - /// `libc::aio_fsync` returns an error - // Skip on Linux, because Linux's AIO implementation can't detect errors - // synchronously - #[test] - #[cfg(any(target_os = "freebsd", target_os = "macos"))] - fn error() { - use std::mem; - - const INITIAL: &[u8] = b"abcdef123456"; - // Create an invalid AioFsyncMode - let mode = unsafe { mem::transmute(666) }; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let mut aiof = Box::pin(AioFsync::new( - f.as_raw_fd(), - mode, - 0, - SigevNotify::SigevNone, - )); - let err = aiof.as_mut().submit(); - err.expect_err("assertion failed"); - } + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn ok() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let fd = f.as_raw_fd(); - let mut aiof = Box::pin(AioFsync::new( - fd, - AioFsyncMode::O_SYNC, - 0, - SigevNotify::SigevNone, - )); - aiof.as_mut().submit().unwrap(); - poll_aio!(&mut aiof).unwrap(); - aiof.as_mut().aio_return().unwrap(); - } + let cancelstat = aiocb.cancel(); + assert!(cancelstat.is_ok()); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); } -mod aio_read { - use super::*; - - #[test] - fn test_accessors() { - let mut rbuf = vec![0; 4]; - let aiocb = AioRead::new( - 1001, - 2, //offset - &mut rbuf, - 42, //priority - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 99, - }, - ); - assert_eq!(1001, aiocb.fd()); - assert_eq!(4, aiocb.nbytes()); - assert_eq!(2, aiocb.offset()); - assert_eq!(42, aiocb.priority()); - let sev = aiocb.sigevent().sigevent(); - assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); - assert_eq!(99, sev.sigev_value.sival_ptr as i64); - } +// Tests using aio_cancel_all for all outstanding IOs. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_aio_cancel_all() { + let wbuf: &[u8] = b"CDEF"; - // Tests AioWrite.cancel. We aren't trying to test the OS's implementation, - // only our bindings. So it's sufficient to check that cancel - // returned any AioCancelStat value. - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn cancel() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut rbuf = vec![0; 4]; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let fd = f.as_raw_fd(); - let mut aior = - Box::pin(AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone)); - aior.as_mut().submit().unwrap(); - - aior.as_mut().cancel().unwrap(); - - // Wait for aiow to complete, but don't care whether it succeeded - let _ = poll_aio!(&mut aior); - let _ = aior.as_mut().aio_return(); - } + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice(f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); - /// `AioRead::submit` should not modify the `AioCb` object if - /// `libc::aio_read` returns an error - // Skip on Linux, because Linux's AIO implementation can't detect errors - // synchronously - #[test] - #[cfg(any(target_os = "freebsd", target_os = "macos"))] - fn error() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut rbuf = vec![0; 4]; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let mut aior = Box::pin(AioRead::new( - f.as_raw_fd(), - -1, //an invalid offset - &mut rbuf, - 0, //priority - SigevNotify::SigevNone, - )); - aior.as_mut().submit().expect_err("assertion failed"); - } + let cancelstat = aio_cancel_all(f.as_raw_fd()); + assert!(cancelstat.is_ok()); - // Test a simple aio operation with no completion notification. We must - // poll for completion - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn ok() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut rbuf = vec![0; 4]; - const EXPECT: &[u8] = b"cdef"; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - { - let fd = f.as_raw_fd(); - let mut aior = Box::pin(AioRead::new( - fd, - 2, - &mut rbuf, - 0, - SigevNotify::SigevNone, - )); - aior.as_mut().submit().unwrap(); + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); +} - let err = poll_aio!(&mut aior); - assert_eq!(err, Ok(())); - assert_eq!(aior.as_mut().aio_return().unwrap(), EXPECT.len()); - } - assert_eq!(EXPECT, rbuf.deref().deref()); - } +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_fsync() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(AioFsyncMode::O_SYNC); + assert!(err.is_ok()); + poll_aio(&mut aiocb).unwrap(); + aiocb.aio_return().unwrap(); +} - // Like ok, but allocates the structure on the stack. - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn on_stack() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut rbuf = vec![0; 4]; - const EXPECT: &[u8] = b"cdef"; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - { - let fd = f.as_raw_fd(); - let mut aior = - AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone); - let mut aior = unsafe { Pin::new_unchecked(&mut aior) }; - aior.as_mut().submit().unwrap(); - - let err = poll_aio!(&mut aior); - assert_eq!(err, Ok(())); - assert_eq!(aior.as_mut().aio_return().unwrap(), EXPECT.len()); - } - assert_eq!(EXPECT, rbuf.deref().deref()); - } +/// `AioCb::fsync` should not modify the `AioCb` object if `libc::aio_fsync` returns +/// an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_fsync_error() { + use std::mem; + + const INITIAL: &[u8] = b"abcdef123456"; + // Create an invalid AioFsyncMode + let mode = unsafe { mem::transmute(666) }; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(mode); + assert!(err.is_err()); } -#[cfg(target_os = "freebsd")] -#[cfg(fbsd14)] -mod aio_readv { - use std::io::IoSliceMut; - - use super::*; - - #[test] - fn test_accessors() { - let mut rbuf0 = vec![0; 4]; - let mut rbuf1 = vec![0; 8]; - let mut rbufs = - [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; - let aiocb = AioReadv::new( - 1001, - 2, //offset - &mut rbufs, - 42, //priority - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 99, - }, - ); - assert_eq!(1001, aiocb.fd()); - assert_eq!(2, aiocb.iovlen()); - assert_eq!(2, aiocb.offset()); - assert_eq!(42, aiocb.priority()); - let sev = aiocb.sigevent().sigevent(); - assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); - assert_eq!(99, sev.sigev_value.sival_ptr as i64); - } +#[test] +// On Cirrus on Linux, this test fails due to a glibc bug. +// https://github.com/nix-rust/nix/issues/1099 +#[cfg_attr(target_os = "linux", ignore)] +// On Cirrus, aio_suspend is failing with EINVAL +// https://github.com/nix-rust/nix/issues/1361 +#[cfg_attr(target_os = "macos", ignore)] +fn test_aio_suspend() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEFG"; + let timeout = TimeSpec::seconds(10); + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn ok() { - const INITIAL: &[u8] = b"abcdef123456"; - let mut rbuf0 = vec![0; 4]; - let mut rbuf1 = vec![0; 2]; - let mut rbufs = - [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; - const EXPECT0: &[u8] = b"cdef"; - const EXPECT1: &[u8] = b"12"; - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); + let mut wcb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + + let mut rcb = AioCb::from_mut_slice( f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ); + wcb.write().unwrap(); + rcb.read().unwrap(); + loop { { - let fd = f.as_raw_fd(); - let mut aior = Box::pin(AioReadv::new( - fd, - 2, - &mut rbufs, - 0, - SigevNotify::SigevNone, - )); - aior.as_mut().submit().unwrap(); - - let err = poll_aio!(&mut aior); - assert_eq!(err, Ok(())); - assert_eq!( - aior.as_mut().aio_return().unwrap(), - EXPECT0.len() + EXPECT1.len() - ); + let cbbuf = [wcb.as_ref(), rcb.as_ref()]; + let r = aio_suspend(&cbbuf[..], Some(timeout)); + match r { + Err(Errno::EINTR) => continue, + Err(e) => panic!("aio_suspend returned {:?}", e), + Ok(_) => () + }; + } + if rcb.error() != Err(Errno::EINPROGRESS) && + wcb.error() != Err(Errno::EINPROGRESS) { + break } - assert_eq!(&EXPECT0, &rbuf0); - assert_eq!(&EXPECT1, &rbuf1); } + + assert_eq!(wcb.aio_return().unwrap() as usize, WBUF.len()); + assert_eq!(rcb.aio_return().unwrap() as usize, rlen); } -mod aio_write { - use super::*; - - #[test] - fn test_accessors() { - let wbuf = vec![0; 4]; - let aiocb = AioWrite::new( - 1001, - 2, //offset - &wbuf, - 42, //priority - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 99, - }, - ); - assert_eq!(1001, aiocb.fd()); - assert_eq!(4, aiocb.nbytes()); - assert_eq!(2, aiocb.offset()); - assert_eq!(42, aiocb.priority()); - let sev = aiocb.sigevent().sigevent(); - assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); - assert_eq!(99, sev.sigev_value.sival_ptr as i64); +// Test a simple aio operation with no completion notification. We must poll +// for completion +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); } - // Tests AioWrite.cancel. We aren't trying to test the OS's implementation, - // only our bindings. So it's sufficient to check that cancel - // returned any AioCancelStat value. - #[test] - #[cfg_attr(target_env = "musl", ignore)] - fn cancel() { - let wbuf: &[u8] = b"CDEF"; - - let f = tempfile().unwrap(); - let mut aiow = Box::pin(AioWrite::new( - f.as_raw_fd(), - 0, - wbuf, - 0, - SigevNotify::SigevNone, - )); - aiow.as_mut().submit().unwrap(); - let err = aiow.as_mut().error(); - assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + assert_eq!(EXPECT, rbuf.deref().deref()); +} - aiow.as_mut().cancel().unwrap(); +/// `AioCb::read` should not modify the `AioCb` object if `libc::aio_read` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_read_error() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + -1, //an invalid offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.read().is_err()); +} - // Wait for aiow to complete, but don't care whether it succeeded - let _ = poll_aio!(&mut aiow); - let _ = aiow.as_mut().aio_return(); +// Tests from_mut_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_mut_slice() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); } - // Test a simple aio operation with no completion notification. We must - // poll for completion. - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn ok() { - const INITIAL: &[u8] = b"abcdef123456"; - let wbuf = "CDEF".to_string().into_bytes(); - let mut rbuf = Vec::new(); - const EXPECT: &[u8] = b"abCDEF123456"; - - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let mut aiow = Box::pin(AioWrite::new( - f.as_raw_fd(), - 2, - &wbuf, - 0, - SigevNotify::SigevNone, - )); - aiow.as_mut().submit().unwrap(); + assert_eq!(rbuf, EXPECT); +} - let err = poll_aio!(&mut aiow); +// Tests from_ptr +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + // Safety: ok because rbuf lives until after poll_aio + let mut aiocb = unsafe { + AioCb::from_mut_ptr( f.as_raw_fd(), + 2, //offset + rbuf.as_mut_ptr() as *mut c_void, + rbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); assert_eq!(err, Ok(())); - assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len()); - - f.seek(SeekFrom::Start(0)).unwrap(); - let len = f.read_to_end(&mut rbuf).unwrap(); - assert_eq!(len, EXPECT.len()); - assert_eq!(rbuf, EXPECT); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); } - // Like ok, but allocates the structure on the stack. - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn on_stack() { - const INITIAL: &[u8] = b"abcdef123456"; - let wbuf = "CDEF".to_string().into_bytes(); - let mut rbuf = Vec::new(); - const EXPECT: &[u8] = b"abCDEF123456"; - - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let mut aiow = AioWrite::new( - f.as_raw_fd(), - 2, //offset - &wbuf, - 0, //priority - SigevNotify::SigevNone, - ); - let mut aiow = unsafe { Pin::new_unchecked(&mut aiow) }; - aiow.as_mut().submit().unwrap(); + assert_eq!(rbuf, EXPECT); +} - let err = poll_aio!(&mut aiow); - assert_eq!(err, Ok(())); - assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len()); +// Test reading into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_read_immutable_buffer() { + let rbuf: &[u8] = b"CDEF"; + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); +} - f.seek(SeekFrom::Start(0)).unwrap(); - let len = f.read_to_end(&mut rbuf).unwrap(); - assert_eq!(len, EXPECT.len()); - assert_eq!(rbuf, EXPECT); - } - /// `AioWrite::write` should not modify the `AioCb` object if - /// `libc::aio_write` returns an error. - // Skip on Linux, because Linux's AIO implementation can't detect errors - // synchronously - #[test] - #[cfg(any(target_os = "freebsd", target_os = "macos"))] - fn error() { - let wbuf = "CDEF".to_string().into_bytes(); - let mut aiow = Box::pin(AioWrite::new( - 666, // An invalid file descriptor - 0, //offset - &wbuf, - 0, //priority - SigevNotify::SigevNone, - )); - aiow.as_mut().submit().expect_err("assertion failed"); - // Dropping the AioWrite at this point should not panic - } +// Test a simple aio operation with no completion notification. We must poll +// for completion. Unlike test_aio_read, this test uses AioCb::from_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); } -#[cfg(target_os = "freebsd")] -#[cfg(fbsd14)] -mod aio_writev { - use std::io::IoSlice; - - use super::*; - - #[test] - fn test_accessors() { - let wbuf0 = vec![0; 4]; - let wbuf1 = vec![0; 8]; - let wbufs = [IoSlice::new(&wbuf0), IoSlice::new(&wbuf1)]; - let aiocb = AioWritev::new( - 1001, - 2, //offset - &wbufs, - 42, //priority - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 99, - }, - ); - assert_eq!(1001, aiocb.fd()); - assert_eq!(2, aiocb.iovlen()); - assert_eq!(2, aiocb.offset()); - assert_eq!(42, aiocb.priority()); - let sev = aiocb.sigevent().sigevent(); - assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); - assert_eq!(99, sev.sigev_value.sival_ptr as i64); - } +// Tests `AioCb::from_ptr` +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write_from_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; - // Test a simple aio operation with no completion notification. We must - // poll for completion. - #[test] - #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] - fn ok() { - const INITIAL: &[u8] = b"abcdef123456"; - let wbuf0 = b"BC"; - let wbuf1 = b"DEF"; - let wbufs = [IoSlice::new(wbuf0), IoSlice::new(wbuf1)]; - let wlen = wbuf0.len() + wbuf1.len(); - let mut rbuf = Vec::new(); - const EXPECT: &[u8] = b"aBCDEF123456"; - - let mut f = tempfile().unwrap(); - f.write_all(INITIAL).unwrap(); - let mut aiow = Box::pin(AioWritev::new( - f.as_raw_fd(), - 1, - &wbufs, - 0, - SigevNotify::SigevNone, - )); - aiow.as_mut().submit().unwrap(); + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + // Safety: ok because aiocb outlives poll_aio + let mut aiocb = unsafe { + AioCb::from_ptr( f.as_raw_fd(), + 2, //offset + wbuf.as_ptr() as *const c_void, + wbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.write().unwrap(); - let err = poll_aio!(&mut aiow); - assert_eq!(err, Ok(())); - assert_eq!(aiow.as_mut().aio_return().unwrap(), wlen); + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); - f.seek(SeekFrom::Start(0)).unwrap(); - let len = f.read_to_end(&mut rbuf).unwrap(); - assert_eq!(len, EXPECT.len()); - assert_eq!(rbuf, EXPECT); - } + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +/// `AioCb::write` should not modify the `AioCb` object if `libc::aio_write` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_write_error() { + let wbuf = "CDEF".to_string().into_bytes(); + let mut aiocb = AioCb::from_slice( 666, // An invalid file descriptor + 0, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.write().is_err()); +} + +lazy_static! { + pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern fn sigfunc(_: c_int) { + SIGNALED.store(true, Ordering::Relaxed); } // Test an aio operation with completion delivered by a signal +// FIXME: This test is ignored on mips because of failures in qemu in CI #[test] -#[cfg_attr( - any( - all(target_env = "musl", target_arch = "x86_64"), - target_arch = "mips", - target_arch = "mips64" - ), - ignore -)] -fn sigev_signal() { +#[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips", target_arch = "mips64"), ignore)] +fn test_write_sigev_signal() { let _m = crate::SIGNAL_MTX.lock(); - let sa = SigAction::new( - SigHandler::Handler(sigfunc), - SaFlags::SA_RESETHAND, - SigSet::empty(), - ); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); SIGNALED.store(false, Ordering::Relaxed); unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); @@ -521,106 +420,201 @@ fn sigev_signal() { let mut f = tempfile().unwrap(); f.write_all(INITIAL).unwrap(); - let mut aiow = Box::pin(AioWrite::new( - f.as_raw_fd(), - 2, //offset - WBUF, - 0, //priority - SigevNotify::SigevSignal { - signal: Signal::SIGUSR2, - si_value: 0, //TODO: validate in sigfunc - }, - )); - aiow.as_mut().submit().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 0 //TODO: validate in sigfunc + }, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); while !SIGNALED.load(Ordering::Relaxed) { thread::sleep(time::Duration::from_millis(10)); } - assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); + assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); f.seek(SeekFrom::Start(0)).unwrap(); let len = f.read_to_end(&mut rbuf).unwrap(); assert_eq!(len, EXPECT.len()); assert_eq!(rbuf, EXPECT); } -// Tests using aio_cancel_all for all outstanding IOs. +// Test LioCb::listio with LIO_WAIT, so all AIO ops should be complete by the +// time listio returns. #[test] -#[cfg_attr(target_env = "musl", ignore)] -fn test_aio_cancel_all() { - let wbuf: &[u8] = b"CDEF"; +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_wait() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); - let f = tempfile().unwrap(); - let mut aiocb = Box::pin(AioWrite::new( - f.as_raw_fd(), - 0, //offset - wbuf, - 0, //priority - SigevNotify::SigevNone, - )); - aiocb.as_mut().submit().unwrap(); - let err = aiocb.as_mut().error(); - assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + f.write_all(INITIAL).unwrap(); - aio_cancel_all(f.as_raw_fd()).unwrap(); + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); - // Wait for aiocb to complete, but don't care whether it succeeded - let _ = poll_aio!(&mut aiocb); - let _ = aiocb.as_mut().aio_return(); + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); } +// Test LioCb::listio with LIO_NOWAIT and no SigEvent, so we must use some other +// mechanism to check for the individual AioCb's completion. #[test] -// On Cirrus on Linux, this test fails due to a glibc bug. -// https://github.com/nix-rust/nix/issues/1099 -#[cfg_attr(target_os = "linux", ignore)] -// On Cirrus, aio_suspend is failing with EINVAL -// https://github.com/nix-rust/nix/issues/1361 -#[cfg_attr(target_os = "macos", ignore)] -fn test_aio_suspend() { +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_nowait() { const INITIAL: &[u8] = b"abcdef123456"; - const WBUF: &[u8] = b"CDEFG"; - let timeout = TimeSpec::seconds(10); + const WBUF: &[u8] = b"CDEF"; let mut rbuf = vec![0; 4]; let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); - let mut wcb = Box::pin(AioWrite::new( - f.as_raw_fd(), - 2, //offset - WBUF, - 0, //priority - SigevNotify::SigevNone, - )); - - let mut rcb = Box::pin(AioRead::new( - f.as_raw_fd(), - 8, //offset - &mut rbuf, - 0, //priority - SigevNotify::SigevNone, - )); - wcb.as_mut().submit().unwrap(); - rcb.as_mut().submit().unwrap(); - loop { - { - let cbbuf = [ - &*wcb as &dyn AsRef, - &*rcb as &dyn AsRef, - ]; - let r = aio_suspend(&cbbuf[..], Some(timeout)); - match r { - Err(Errno::EINTR) => continue, - Err(e) => panic!("aio_suspend returned {:?}", e), - Ok(_) => (), - }; - } - if rcb.as_mut().error() != Err(Errno::EINPROGRESS) - && wcb.as_mut().error() != Err(Errno::EINPROGRESS) - { - break; + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); + + poll_lio(&mut liocb, 0).unwrap(); + poll_lio(&mut liocb, 1).unwrap(); + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Test LioCb::listio with LIO_NOWAIT and a SigEvent to indicate when all +// AioCb's are complete. +// FIXME: This test is ignored on mips/mips64 because of failures in qemu in CI. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(any(target_arch = "mips", target_arch = "mips64", target_env = "musl"), ignore)] +fn test_liocb_listio_signal() { + let _m = crate::SIGNAL_MTX.lock(); + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); + let sigev_notify = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, + si_value: 0 }; + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + let err = liocb.listio(LioMode::LIO_NOWAIT, sigev_notify); + err.expect("lio_listio"); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); } + + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} - assert_eq!(wcb.as_mut().aio_return().unwrap(), WBUF.len()); - assert_eq!(rcb.as_mut().aio_return().unwrap(), rlen); +// Try to use LioCb::listio to read into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_liocb_listio_read_immutable() { + let rbuf: &[u8] = b"abcd"; + let f = tempfile().unwrap(); + + + let mut liocb = LioCbBuilder::with_capacity(1) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let _ = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); } diff --git a/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs b/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs index bbe6623fd77a06a9c37f9f9352163cd92e547abb..f9ff97af6ced1d0ad9ab66daa78f4269e15611ba 100644 --- a/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs +++ b/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs @@ -3,17 +3,13 @@ // the AIO subsystem and causes subsequent tests to fail #[test] #[should_panic(expected = "Dropped an in-progress AioCb")] -#[cfg(all( - not(target_env = "musl"), - not(target_env = "uclibc"), - any( - target_os = "linux", - target_os = "ios", - target_os = "macos", - target_os = "freebsd", - target_os = "netbsd" - ) -))] +#[cfg(all(not(target_env = "musl"), + not(target_env = "uclibc"), + any(target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd")))] fn test_drop() { use nix::sys::aio::*; use nix::sys::signal::*; @@ -24,12 +20,11 @@ fn test_drop() { let f = tempfile().unwrap(); f.set_len(6).unwrap(); - let mut aiocb = Box::pin(AioWrite::new( - f.as_raw_fd(), - 2, //offset - WBUF, - 0, //priority - SigevNotify::SigevNone, - )); - aiocb.as_mut().submit().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); } diff --git a/bash-5.1/vendor/nix/test/sys/test_epoll.rs b/bash-5.1/vendor/nix/test/sys/test_epoll.rs index 915691595c4f6aa1f962f4f13e54ba5235c07444..8d44cd08f01c9be80e9c75dbecb5b85814ab083c 100644 --- a/bash-5.1/vendor/nix/test/sys/test_epoll.rs +++ b/bash-5.1/vendor/nix/test/sys/test_epoll.rs @@ -1,24 +1,23 @@ -use nix::errno::Errno; +use nix::sys::epoll::{EpollCreateFlags, EpollFlags, EpollOp, EpollEvent}; use nix::sys::epoll::{epoll_create1, epoll_ctl}; -use nix::sys::epoll::{EpollCreateFlags, EpollEvent, EpollFlags, EpollOp}; +use nix::errno::Errno; #[test] pub fn test_epoll_errno() { let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); let result = epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None); - result.expect_err("assertion failed"); + assert!(result.is_err()); assert_eq!(result.unwrap_err(), Errno::ENOENT); let result = epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, None); - result.expect_err("assertion failed"); + assert!(result.is_err()); assert_eq!(result.unwrap_err(), Errno::EINVAL); } #[test] pub fn test_epoll_ctl() { let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); - let mut event = - EpollEvent::new(EpollFlags::EPOLLIN | EpollFlags::EPOLLERR, 1); + let mut event = EpollEvent::new(EpollFlags::EPOLLIN | EpollFlags::EPOLLERR, 1); epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, &mut event).unwrap(); epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None).unwrap(); } diff --git a/bash-5.1/vendor/nix/test/sys/test_inotify.rs b/bash-5.1/vendor/nix/test/sys/test_inotify.rs index bb5851a903c54f2ada91a54a4ab4ca463f8192d4..137816a352086cfc17f7d3711fbfb4dd4c5a5361 100644 --- a/bash-5.1/vendor/nix/test/sys/test_inotify.rs +++ b/bash-5.1/vendor/nix/test/sys/test_inotify.rs @@ -1,16 +1,15 @@ +use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; use nix::errno::Errno; -use nix::sys::inotify::{AddWatchFlags, InitFlags, Inotify}; use std::ffi::OsString; use std::fs::{rename, File}; #[test] pub fn test_inotify() { - let instance = Inotify::init(InitFlags::IN_NONBLOCK).unwrap(); + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); let tempdir = tempfile::tempdir().unwrap(); - instance - .add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS) - .unwrap(); + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); let events = instance.read_events(); assert_eq!(events.unwrap_err(), Errno::EAGAIN); @@ -23,12 +22,11 @@ pub fn test_inotify() { #[test] pub fn test_inotify_multi_events() { - let instance = Inotify::init(InitFlags::IN_NONBLOCK).unwrap(); + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); let tempdir = tempfile::tempdir().unwrap(); - instance - .add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS) - .unwrap(); + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); let events = instance.read_events(); assert_eq!(events.unwrap_err(), Errno::EAGAIN); diff --git a/bash-5.1/vendor/nix/test/sys/test_ioctl.rs b/bash-5.1/vendor/nix/test/sys/test_ioctl.rs index 7a603c5bbae3b8a2da228267cfcc753cdd37a078..236d24268a738493ca5229e3109e9cb82a4129a6 100644 --- a/bash-5.1/vendor/nix/test/sys/test_ioctl.rs +++ b/bash-5.1/vendor/nix/test/sys/test_ioctl.rs @@ -32,12 +32,7 @@ ioctl_readwrite_buf!(readwritebuf_test, 0, 0, u32); mod linux { #[test] fn test_op_none() { - if cfg!(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64" - )) { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(request_code_none!(b'q', 10) as u32, 0x2000_710A); assert_eq!(request_code_none!(b'a', 255) as u32, 0x2000_61FF); } else { @@ -48,12 +43,7 @@ mod linux { #[test] fn test_op_write() { - if cfg!(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64" - )) { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x8001_7A0A); assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x8200_7A0A); } else { @@ -65,27 +55,19 @@ mod linux { #[cfg(target_pointer_width = "64")] #[test] fn test_op_write_64() { - if cfg!(any(target_arch = "mips64", target_arch = "powerpc64")) { - assert_eq!( - request_code_write!(b'z', 10, 1u64 << 32) as u32, - 0x8000_7A0A - ); + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); } else { - assert_eq!( - request_code_write!(b'z', 10, 1u64 << 32) as u32, - 0x4000_7A0A - ); + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); } + } #[test] fn test_op_read() { - if cfg!(any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64" - )) { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x4001_7A0A); assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x4200_7A0A); } else { @@ -97,16 +79,12 @@ mod linux { #[cfg(target_pointer_width = "64")] #[test] fn test_op_read_64() { - if cfg!(any(target_arch = "mips64", target_arch = "powerpc64")) { - assert_eq!( - request_code_read!(b'z', 10, 1u64 << 32) as u32, - 0x4000_7A0A - ); + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); } else { - assert_eq!( - request_code_read!(b'z', 10, 1u64 << 32) as u32, - 0x8000_7A0A - ); + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); } } @@ -119,21 +97,17 @@ mod linux { #[cfg(target_pointer_width = "64")] #[test] fn test_op_read_write_64() { - assert_eq!( - request_code_readwrite!(b'z', 10, 1u64 << 32) as u32, - 0xC000_7A0A - ); + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32) as u32, + 0xC000_7A0A); } } -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] mod bsd { #[test] fn test_op_none() { @@ -190,8 +164,8 @@ mod linux_ioctls { use std::mem; use std::os::unix::io::AsRawFd; - use libc::{termios, TCGETS, TCSBRK, TCSETS, TIOCNXCL}; use tempfile::tempfile; + use libc::{TCGETS, TCSBRK, TCSETS, TIOCNXCL, termios}; use nix::errno::Errno; @@ -281,7 +255,7 @@ mod linux_ioctls { } // From linux/videodev2.h - ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); + ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); #[test] fn test_ioctl_readwrite() { let file = tempfile().unwrap(); @@ -307,12 +281,7 @@ mod linux_ioctls { } // From linux/spi/spidev.h - ioctl_write_buf!( - spi_ioc_message, - super::SPI_IOC_MAGIC, - super::SPI_IOC_MESSAGE, - spi_ioc_transfer - ); + ioctl_write_buf!(spi_ioc_message, super::SPI_IOC_MAGIC, super::SPI_IOC_MESSAGE, spi_ioc_transfer); #[test] fn test_ioctl_write_buf() { let file = tempfile().unwrap(); @@ -329,8 +298,8 @@ mod freebsd_ioctls { use std::mem; use std::os::unix::io::AsRawFd; - use libc::termios; use tempfile::tempfile; + use libc::termios; use nix::errno::Errno; diff --git a/bash-5.1/vendor/nix/test/sys/test_lio_listio_resubmit.rs b/bash-5.1/vendor/nix/test/sys/test_lio_listio_resubmit.rs new file mode 100644 index 0000000000000000000000000000000000000000..c9077891cb192e133c7bdbbef6b7f0cee5bec4b6 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_lio_listio_resubmit.rs @@ -0,0 +1,106 @@ +// vim: tw=80 + +// Annoyingly, Cargo is unable to conditionally build an entire test binary. So +// we must disable the test here rather than in Cargo.toml +#![cfg(target_os = "freebsd")] + +use nix::errno::*; +use nix::libc::off_t; +use nix::sys::aio::*; +use nix::sys::signal::SigevNotify; +use nix::unistd::{SysconfVar, sysconf}; +use std::os::unix::io::AsRawFd; +use std::{thread, time}; +use sysctl::CtlValue; +use tempfile::tempfile; + +const BYTES_PER_OP: usize = 512; + +/// Attempt to collect final status for all of `liocb`'s operations, freeing +/// system resources +fn finish_liocb(liocb: &mut LioCb) { + for j in 0..liocb.len() { + loop { + let e = liocb.error(j); + match e { + Ok(()) => break, + Err(Errno::EINPROGRESS) => + thread::sleep(time::Duration::from_millis(10)), + Err(x) => panic!("aio_error({:?})", x) + } + } + assert_eq!(liocb.aio_return(j).unwrap(), BYTES_PER_OP as isize); + } +} + +// Deliberately exceed system resource limits, causing lio_listio to return EIO. +// This test must run in its own process since it deliberately uses all AIO +// resources. ATM it is only enabled on FreeBSD, because I don't know how to +// check system AIO limits on other operating systems. +#[test] +fn test_lio_listio_resubmit() { + let mut resubmit_count = 0; + + // Lookup system resource limits + let alm = sysconf(SysconfVar::AIO_LISTIO_MAX) + .expect("sysconf").unwrap() as usize; + let maqpp = if let CtlValue::Int(x) = sysctl::value( + "vfs.aio.max_aio_queue_per_proc").unwrap(){ + x as usize + } else { + panic!("unknown sysctl"); + }; + + // Find lio_listio sizes that satisfy the AIO_LISTIO_MAX constraint and also + // result in a final lio_listio call that can only partially be queued + let target_ops = maqpp + alm / 2; + let num_listios = (target_ops + alm - 3) / (alm - 2); + let ops_per_listio = (target_ops + num_listios - 1) / num_listios; + assert!((num_listios - 1) * ops_per_listio < maqpp, + "the last lio_listio won't make any progress; fix the algorithm"); + println!("Using {:?} LioCbs of {:?} operations apiece", num_listios, + ops_per_listio); + + let f = tempfile().unwrap(); + let buffer_set = (0..num_listios).map(|_| { + (0..ops_per_listio).map(|_| { + vec![0u8; BYTES_PER_OP] + }).collect::>() + }).collect::>(); + + let mut liocbs = (0..num_listios).map(|i| { + let mut builder = LioCbBuilder::with_capacity(ops_per_listio); + for j in 0..ops_per_listio { + let offset = (BYTES_PER_OP * (i * ops_per_listio + j)) as off_t; + builder = builder.emplace_slice(f.as_raw_fd(), + offset, + &buffer_set[i][j][..], + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + } + let mut liocb = builder.finish(); + let mut err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + while err == Err(Errno::EIO) || + err == Err(Errno::EAGAIN) || + err == Err(Errno::EINTR) { + // + thread::sleep(time::Duration::from_millis(10)); + resubmit_count += 1; + err = liocb.listio_resubmit(LioMode::LIO_NOWAIT, + SigevNotify::SigevNone); + } + liocb + }).collect::>(); + + // Ensure that every AioCb completed + for liocb in liocbs.iter_mut() { + finish_liocb(liocb); + } + + if resubmit_count > 0 { + println!("Resubmitted {:?} times, test passed", resubmit_count); + } else { + println!("Never resubmitted. Test ambiguous"); + } +} diff --git a/bash-5.1/vendor/nix/test/sys/test_mman.rs b/bash-5.1/vendor/nix/test/sys/test_mman.rs index 75cbf6ce8cdabf57e0a5755e196c5c28f59f3611..8858375a3c721832e19bdb40f70e9ba5cfd03f51 100644 --- a/bash-5.1/vendor/nix/test/sys/test_mman.rs +++ b/bash-5.1/vendor/nix/test/sys/test_mman.rs @@ -3,73 +3,53 @@ use nix::sys::mman::{mmap, MapFlags, ProtFlags}; #[test] fn test_mmap_anonymous() { unsafe { - let ptr = mmap( - std::ptr::null_mut(), - 1, - ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, - MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, - -1, - 0, - ) - .unwrap() as *mut u8; - assert_eq!(*ptr, 0x00u8); + let ptr = mmap(std::ptr::null_mut(), 1, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, -1, 0) + .unwrap() as *mut u8; + assert_eq !(*ptr, 0x00u8); *ptr = 0xffu8; - assert_eq!(*ptr, 0xffu8); + assert_eq !(*ptr, 0xffu8); } } #[test] #[cfg(any(target_os = "linux", target_os = "netbsd"))] fn test_mremap_grow() { - use nix::libc::{c_void, size_t}; use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; - const ONE_K: size_t = 1024; - let slice: &mut [u8] = unsafe { - let mem = mmap( - std::ptr::null_mut(), - ONE_K, - ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, - MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, - -1, - 0, - ) - .unwrap(); - std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) }; - assert_eq!(slice[ONE_K - 1], 0x00); + assert_eq !(slice[ONE_K - 1], 0x00); slice[ONE_K - 1] = 0xFF; - assert_eq!(slice[ONE_K - 1], 0xFF); + assert_eq !(slice[ONE_K - 1], 0xFF); - let slice: &mut [u8] = unsafe { + let slice : &mut[u8] = unsafe { #[cfg(target_os = "linux")] - let mem = mremap( - slice.as_mut_ptr() as *mut c_void, - ONE_K, - 10 * ONE_K, - MRemapFlags::MREMAP_MAYMOVE, - None, - ) - .unwrap(); + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MREMAP_MAYMOVE, None) + .unwrap(); #[cfg(target_os = "netbsd")] - let mem = mremap( - slice.as_mut_ptr() as *mut c_void, - ONE_K, - 10 * ONE_K, - MRemapFlags::MAP_REMAPDUP, - None, - ) - .unwrap(); - std::slice::from_raw_parts_mut(mem as *mut u8, 10 * ONE_K) + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MAP_REMAPDUP, None) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, 10 * ONE_K) }; // The first KB should still have the old data in it. - assert_eq!(slice[ONE_K - 1], 0xFF); + assert_eq !(slice[ONE_K - 1], 0xFF); // The additional range should be zero-init'd and accessible. - assert_eq!(slice[10 * ONE_K - 1], 0x00); + assert_eq !(slice[10 * ONE_K - 1], 0x00); slice[10 * ONE_K - 1] = 0xFF; - assert_eq!(slice[10 * ONE_K - 1], 0xFF); + assert_eq !(slice[10 * ONE_K - 1], 0xFF); } #[test] @@ -77,41 +57,31 @@ fn test_mremap_grow() { // Segfaults for unknown reasons under QEMU for 32-bit targets #[cfg_attr(all(target_pointer_width = "32", qemu), ignore)] fn test_mremap_shrink() { - use nix::libc::{c_void, size_t}; use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; - const ONE_K: size_t = 1024; - let slice: &mut [u8] = unsafe { - let mem = mmap( - std::ptr::null_mut(), - 10 * ONE_K, - ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, - MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, - -1, - 0, - ) - .unwrap(); - std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), 10 * ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) }; - assert_eq!(slice[ONE_K - 1], 0x00); + assert_eq !(slice[ONE_K - 1], 0x00); slice[ONE_K - 1] = 0xFF; - assert_eq!(slice[ONE_K - 1], 0xFF); + assert_eq !(slice[ONE_K - 1], 0xFF); - let slice: &mut [u8] = unsafe { - let mem = mremap( - slice.as_mut_ptr() as *mut c_void, - 10 * ONE_K, - ONE_K, - MRemapFlags::empty(), - None, - ) - .unwrap(); + let slice : &mut[u8] = unsafe { + let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K, + MRemapFlags::empty(), None) + .unwrap(); // Since we didn't supply MREMAP_MAYMOVE, the address should be the // same. - assert_eq!(mem, slice.as_mut_ptr() as *mut c_void); - std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + assert_eq !(mem, slice.as_mut_ptr() as * mut c_void); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) }; // The first KB should still be accessible and have the old data in it. - assert_eq!(slice[ONE_K - 1], 0xFF); + assert_eq !(slice[ONE_K - 1], 0xFF); } diff --git a/bash-5.1/vendor/nix/test/sys/test_pthread.rs b/bash-5.1/vendor/nix/test/sys/test_pthread.rs index ce048bae6019a3e6402e0e19c3a197ea8f6abdf9..fa9b510e8532e64a3f7335e850bdb4b6c7fd353e 100644 --- a/bash-5.1/vendor/nix/test/sys/test_pthread.rs +++ b/bash-5.1/vendor/nix/test/sys/test_pthread.rs @@ -4,14 +4,14 @@ use nix::sys::pthread::*; #[test] fn test_pthread_self() { let tid = pthread_self(); - assert!(!tid.is_null()); + assert!(tid != ::std::ptr::null_mut()); } #[cfg(not(any(target_env = "musl", target_os = "redox")))] #[test] fn test_pthread_self() { let tid = pthread_self(); - assert_ne!(tid, 0); + assert!(tid != 0); } #[test] diff --git a/bash-5.1/vendor/nix/test/sys/test_ptrace.rs b/bash-5.1/vendor/nix/test/sys/test_ptrace.rs index 530560fe175d815a3a288e366b05f9ad3e5cfa37..89c4e2ddad2c9b67182eb1df3322ca0698daab6e 100644 --- a/bash-5.1/vendor/nix/test/sys/test_ptrace.rs +++ b/bash-5.1/vendor/nix/test/sys/test_ptrace.rs @@ -1,14 +1,8 @@ -#[cfg(all( - target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86"), - target_env = "gnu" -))] -use memoffset::offset_of; use nix::errno::Errno; +use nix::unistd::getpid; use nix::sys::ptrace; #[cfg(any(target_os = "android", target_os = "linux"))] use nix::sys::ptrace::Options; -use nix::unistd::getpid; #[cfg(any(target_os = "android", target_os = "linux"))] use std::mem; @@ -21,9 +15,8 @@ fn test_ptrace() { // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS require_capability!("test_ptrace", CAP_SYS_PTRACE); let err = ptrace::attach(getpid()).unwrap_err(); - assert!( - err == Errno::EPERM || err == Errno::EINVAL || err == Errno::ENOSYS - ); + assert!(err == Errno::EPERM || err == Errno::EINVAL || + err == Errno::ENOSYS); } // Just make sure ptrace_setoptions can be called at all, for now. @@ -31,9 +24,8 @@ fn test_ptrace() { #[cfg(any(target_os = "android", target_os = "linux"))] fn test_ptrace_setoptions() { require_capability!("test_ptrace_setoptions", CAP_SYS_PTRACE); - let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD) - .unwrap_err(); - assert_ne!(err, Errno::EOPNOTSUPP); + let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD).unwrap_err(); + assert!(err != Errno::EOPNOTSUPP); } // Just make sure ptrace_getevent can be called at all, for now. @@ -42,7 +34,7 @@ fn test_ptrace_setoptions() { fn test_ptrace_getevent() { require_capability!("test_ptrace_getevent", CAP_SYS_PTRACE); let err = ptrace::getevent(getpid()).unwrap_err(); - assert_ne!(err, Errno::EOPNOTSUPP); + assert!(err != Errno::EOPNOTSUPP); } // Just make sure ptrace_getsiginfo can be called at all, for now. @@ -66,6 +58,7 @@ fn test_ptrace_setsiginfo() { } } + #[test] fn test_ptrace_cont() { use nix::sys::ptrace; @@ -89,7 +82,7 @@ fn test_ptrace_cont() { return; } - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => { ptrace::traceme().unwrap(); // As recommended by ptrace(2), raise SIGTRAP to pause the child @@ -97,22 +90,15 @@ fn test_ptrace_cont() { loop { raise(Signal::SIGTRAP).unwrap(); } - } + + }, Parent { child } => { - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Stopped(child, Signal::SIGTRAP)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); ptrace::cont(child, None).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Stopped(child, Signal::SIGTRAP)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); match waitpid(child, None) { - Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) - if pid == child => - { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { // FIXME It's been observed on some systems (apple) the // tracee may not be killed but remain as a zombie process // affecting other wait based tests. Add an extra kill just @@ -124,7 +110,7 @@ fn test_ptrace_cont() { } _ => panic!("The process should have been killed"), } - } + }, } } @@ -143,28 +129,22 @@ fn test_ptrace_interrupt() { let _m = crate::FORK_MTX.lock(); - match unsafe { fork() }.expect("Error: Fork Failed") { - Child => loop { - sleep(Duration::from_millis(1000)); + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + loop { + sleep(Duration::from_millis(1000)); + } + }, Parent { child } => { - ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD) - .unwrap(); + ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); ptrace::interrupt(child).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128))); ptrace::syscall(child, None).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::PtraceSyscall(child)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); ptrace::detach(child, Some(Signal::SIGKILL)).unwrap(); match waitpid(child, None) { - Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) - if pid == child => - { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); @@ -172,20 +152,19 @@ fn test_ptrace_interrupt() { } _ => panic!("The process should have been killed"), } - } + }, } } // ptrace::{setoptions, getregs} are only available in these platforms -#[cfg(all( - target_os = "linux", - any(target_arch = "x86_64", target_arch = "x86"), - target_env = "gnu" -))] +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] #[test] fn test_ptrace_syscall() { - use nix::sys::ptrace; use nix::sys::signal::kill; + use nix::sys::ptrace; use nix::sys::signal::Signal; use nix::sys::wait::{waitpid, WaitStatus}; use nix::unistd::fork; @@ -196,80 +175,45 @@ fn test_ptrace_syscall() { let _m = crate::FORK_MTX.lock(); - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => { ptrace::traceme().unwrap(); // first sigstop until parent is ready to continue let pid = getpid(); kill(pid, Signal::SIGSTOP).unwrap(); kill(pid, Signal::SIGTERM).unwrap(); - unsafe { - ::libc::_exit(0); - } - } + unsafe { ::libc::_exit(0); } + }, Parent { child } => { - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Stopped(child, Signal::SIGSTOP)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGSTOP))); // set this option to recognize syscall-stops - ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD) - .unwrap(); + ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); #[cfg(target_arch = "x86_64")] - let get_syscall_id = - || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; #[cfg(target_arch = "x86")] - let get_syscall_id = - || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; - - // this duplicates `get_syscall_id` for the purpose of testing `ptrace::read_user`. - #[cfg(target_arch = "x86_64")] - let rax_offset = offset_of!(libc::user_regs_struct, orig_rax); - #[cfg(target_arch = "x86")] - let rax_offset = offset_of!(libc::user_regs_struct, orig_eax); - - let get_syscall_from_user_area = || { - // Find the offset of `user.regs.rax` (or `user.regs.eax` for x86) - let rax_offset = offset_of!(libc::user, regs) + rax_offset; - ptrace::read_user(child, rax_offset as _).unwrap() - as libc::c_long - }; + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; // kill entry ptrace::syscall(child, None).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::PtraceSyscall(child)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); assert_eq!(get_syscall_id(), ::libc::SYS_kill); - assert_eq!(get_syscall_from_user_area(), ::libc::SYS_kill); // kill exit ptrace::syscall(child, None).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::PtraceSyscall(child)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); assert_eq!(get_syscall_id(), ::libc::SYS_kill); - assert_eq!(get_syscall_from_user_area(), ::libc::SYS_kill); // receive signal ptrace::syscall(child, None).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Stopped(child, Signal::SIGTERM)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTERM))); // inject signal ptrace::syscall(child, Signal::SIGTERM).unwrap(); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Signaled(child, Signal::SIGTERM, false)) - ); - } + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, Signal::SIGTERM, false))); + }, } } diff --git a/bash-5.1/vendor/nix/test/sys/test_select.rs b/bash-5.1/vendor/nix/test/sys/test_select.rs index 40bda4d90accabc03854b3d476525fa520b7bb94..2f7396b1895e5bcddbd14dfd82a7775b45545285 100644 --- a/bash-5.1/vendor/nix/test/sys/test_select.rs +++ b/bash-5.1/vendor/nix/test/sys/test_select.rs @@ -1,7 +1,7 @@ use nix::sys::select::*; +use nix::unistd::{pipe, write}; use nix::sys::signal::SigSet; use nix::sys::time::{TimeSpec, TimeValLike}; -use nix::unistd::{pipe, write}; #[test] pub fn test_pselect() { @@ -45,8 +45,7 @@ pub fn test_pselect_nfds2() { None, &timeout, None - ) - .unwrap() + ).unwrap() ); assert!(fd_set.contains(r1)); assert!(!fd_set.contains(r2)); diff --git a/bash-5.1/vendor/nix/test/sys/test_signal.rs b/bash-5.1/vendor/nix/test/sys/test_signal.rs index 3ad14f40c7ca97378bbed427ee3674fec877834d..fdd2568df463be41ce7e1708df3dd1bdc25fd738 100644 --- a/bash-5.1/vendor/nix/test/sys/test_signal.rs +++ b/bash-5.1/vendor/nix/test/sys/test_signal.rs @@ -52,12 +52,9 @@ fn test_sigprocmask() { // Make sure the old set doesn't contain the signal, otherwise the following // test don't make sense. - assert!( - !old_signal_set.contains(SIGNAL), - "the {:?} signal is already blocked, please change to a \ - different one", - SIGNAL - ); + assert!(!old_signal_set.contains(SIGNAL), + "the {:?} signal is already blocked, please change to a \ + different one", SIGNAL); // Now block the signal. let mut signal_set = SigSet::empty(); @@ -69,11 +66,8 @@ fn test_sigprocmask() { old_signal_set.clear(); sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) .expect("expect to be able to retrieve old signals"); - assert!( - old_signal_set.contains(SIGNAL), - "expected the {:?} to be blocked", - SIGNAL - ); + assert!(old_signal_set.contains(SIGNAL), + "expected the {:?} to be blocked", SIGNAL); // Reset the signal. sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&signal_set), None) @@ -84,18 +78,13 @@ lazy_static! { static ref SIGNALED: AtomicBool = AtomicBool::new(false); } -extern "C" fn test_sigaction_handler(signal: libc::c_int) { +extern fn test_sigaction_handler(signal: libc::c_int) { let signal = Signal::try_from(signal).unwrap(); SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); } #[cfg(not(target_os = "redox"))] -extern "C" fn test_sigaction_action( - _: libc::c_int, - _: *mut libc::siginfo_t, - _: *mut libc::c_void, -) { -} +extern fn test_sigaction_action(_: libc::c_int, _: *mut libc::siginfo_t, _: *mut libc::c_void) {} #[test] #[cfg(not(target_os = "redox"))] @@ -103,10 +92,7 @@ fn test_signal_sigaction() { let _m = crate::SIGNAL_MTX.lock(); let action_handler = SigHandler::SigAction(test_sigaction_action); - assert_eq!( - unsafe { signal(Signal::SIGINT, action_handler) }.unwrap_err(), - Errno::ENOTSUP - ); + assert_eq!(unsafe { signal(Signal::SIGINT, action_handler) }.unwrap_err(), Errno::ENOTSUP); } #[test] @@ -115,32 +101,20 @@ fn test_signal() { unsafe { signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); raise(Signal::SIGINT).unwrap(); - assert_eq!( - unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), - SigHandler::SigIgn - ); + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigIgn); let handler = SigHandler::Handler(test_sigaction_handler); - assert_eq!( - unsafe { signal(Signal::SIGINT, handler) }.unwrap(), - SigHandler::SigDfl - ); + assert_eq!(unsafe { signal(Signal::SIGINT, handler) }.unwrap(), SigHandler::SigDfl); raise(Signal::SIGINT).unwrap(); assert!(SIGNALED.load(Ordering::Relaxed)); #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] - assert_eq!( - unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), - handler - ); + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), handler); // System V based OSes (e.g. illumos and Solaris) always resets the // disposition to SIG_DFL prior to calling the signal handler #[cfg(any(target_os = "illumos", target_os = "solaris"))] - assert_eq!( - unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), - SigHandler::SigDfl - ); + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigDfl); // Restore default signal handler unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(); diff --git a/bash-5.1/vendor/nix/test/sys/test_signalfd.rs b/bash-5.1/vendor/nix/test/sys/test_signalfd.rs index 87153c957204c632b3c292f0915f3c85e061fb55..b6f748b46a42b9332dca1cbc7445721a26d1d763 100644 --- a/bash-5.1/vendor/nix/test/sys/test_signalfd.rs +++ b/bash-5.1/vendor/nix/test/sys/test_signalfd.rs @@ -2,8 +2,8 @@ use std::convert::TryFrom; #[test] fn test_signalfd() { - use nix::sys::signal::{self, raise, SigSet, Signal}; use nix::sys::signalfd::SignalFd; + use nix::sys::signal::{self, raise, Signal, SigSet}; // Grab the mutex for altering signals so we don't interfere with other tests. let _m = crate::SIGNAL_MTX.lock(); diff --git a/bash-5.1/vendor/nix/test/sys/test_socket.rs b/bash-5.1/vendor/nix/test/sys/test_socket.rs index b4ca279d67bd85e81b7e09acfb50b39c5cc63df7..2aac795851432411e8a1402db7768fba2b97c37b 100644 --- a/bash-5.1/vendor/nix/test/sys/test_socket.rs +++ b/bash-5.1/vendor/nix/test/sys/test_socket.rs @@ -1,11 +1,7 @@ -#[cfg(any(target_os = "linux", target_os = "android"))] -use crate::*; -use libc::{c_char, sockaddr_storage}; #[allow(deprecated)] use nix::sys::socket::InetAddr; -use nix::sys::socket::{ - getsockname, sockaddr, sockaddr_in6, AddressFamily, UnixAddr, -}; +use nix::sys::socket::{AddressFamily, + UnixAddr, getsockname, sockaddr, sockaddr_in6}; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; use std::mem::{self, MaybeUninit}; @@ -14,6 +10,9 @@ use std::os::unix::io::RawFd; use std::path::Path; use std::slice; use std::str::FromStr; +use libc::{c_char, sockaddr_storage}; +#[cfg(any(target_os = "linux", target_os= "android"))] +use crate::*; #[allow(deprecated)] #[test] @@ -42,7 +41,7 @@ pub fn test_inetv4_addr_to_sock_addr() { #[allow(deprecated)] #[test] pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { - use nix::sys::socket::{sockaddr_storage_to_addr, SockAddr}; + use nix::sys::socket::{SockAddr, sockaddr_storage_to_addr}; let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); let addr = InetAddr::from_std(&actual); @@ -59,12 +58,9 @@ pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { } }; - let from_storage = - sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); assert_eq!(from_storage, sockaddr); - let from_storage = - sockaddr_storage_to_addr(&storage, mem::size_of::()) - .unwrap(); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); assert_eq!(from_storage, sockaddr); } @@ -73,9 +69,8 @@ pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { #[test] pub fn test_timestamping() { use nix::sys::socket::{ - recvmsg, sendmsg, setsockopt, socket, sockopt::Timestamping, - ControlMessageOwned, MsgFlags, SockFlag, SockType, SockaddrIn, - TimestampingFlag, + recvmsg, sendmsg, setsockopt, socket, sockopt::Timestamping, ControlMessageOwned, MsgFlags, + SockaddrIn, SockFlag, SockType, TimestampingFlag, }; use std::io::{IoSlice, IoSliceMut}; @@ -117,9 +112,7 @@ pub fn test_timestamping() { } } let ts = ts.expect("ScmTimestampns is present"); - let sys_time = - ::nix::time::clock_gettime(::nix::time::ClockId::CLOCK_REALTIME) - .unwrap(); + let sys_time = ::nix::time::clock_gettime(::nix::time::ClockId::CLOCK_REALTIME).unwrap(); let diff = if ts > sys_time { ts - sys_time } else { @@ -131,15 +124,14 @@ pub fn test_timestamping() { #[allow(deprecated)] #[test] pub fn test_inetv6_addr_roundtrip_sockaddr_storage_to_addr() { - use nix::sys::socket::{sockaddr_storage_to_addr, SockAddr}; + use nix::sys::socket::{SockAddr, sockaddr_storage_to_addr}; let port: u16 = 3000; let flowinfo: u32 = 1; let scope_id: u32 = 2; let ip: Ipv6Addr = "fe80::1".parse().unwrap(); - let actual = - SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); + let actual = SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); let addr = InetAddr::from_std(&actual); let sockaddr = SockAddr::new_inet(addr); @@ -149,20 +141,14 @@ pub fn test_inetv6_addr_roundtrip_sockaddr_storage_to_addr() { let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); assert_eq!(mem::size_of::(), ffi_size as usize); unsafe { - storage_ptr.copy_from_nonoverlapping( - (ffi_ptr as *const sockaddr).cast::(), - 1, - ); + storage_ptr.copy_from_nonoverlapping((ffi_ptr as *const sockaddr).cast::(), 1); (storage.assume_init(), ffi_size) } }; - let from_storage = - sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); assert_eq!(from_storage, sockaddr); - let from_storage = - sockaddr_storage_to_addr(&storage, mem::size_of::()) - .unwrap(); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); assert_eq!(from_storage, sockaddr); } @@ -204,7 +190,7 @@ pub fn test_addr_equality_path() { pub fn test_abstract_sun_path_too_long() { let name = String::from("nix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0testttttnix\0abstract\0test\0make\0sure\0this\0is\0long\0enough"); let addr = UnixAddr::new_abstract(name.as_bytes()); - addr.expect_err("assertion failed"); + assert!(addr.is_err()); } #[cfg(any(target_os = "android", target_os = "linux"))] @@ -234,8 +220,7 @@ pub fn test_abstract_uds_addr() { let name = String::from("nix\0abstract\0test"); let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); let sun_path = [ - 110u8, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, - 115, 116, + 110u8, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116 ]; assert_eq!(addr.as_abstract(), Some(&sun_path[..])); assert_eq!(addr.path(), None); @@ -246,18 +231,13 @@ pub fn test_abstract_uds_addr() { #[test] pub fn test_getsockname() { + use nix::sys::socket::{socket, AddressFamily, SockType, SockFlag}; use nix::sys::socket::bind; - use nix::sys::socket::{socket, AddressFamily, SockFlag, SockType}; let tempdir = tempfile::tempdir().unwrap(); let sockname = tempdir.path().join("sock"); - let sock = socket( - AddressFamily::Unix, - SockType::Stream, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let sock = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); let sockaddr = UnixAddr::new(&sockname).unwrap(); bind(sock, &sockaddr).expect("bind failed"); assert_eq!(sockaddr, getsockname(sock).expect("getsockname failed")); @@ -265,53 +245,30 @@ pub fn test_getsockname() { #[test] pub fn test_socketpair() { - use nix::sys::socket::{socketpair, AddressFamily, SockFlag, SockType}; use nix::unistd::{read, write}; + use nix::sys::socket::{socketpair, AddressFamily, SockType, SockFlag}; - let (fd1, fd2) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); write(fd1, b"hello").unwrap(); - let mut buf = [0; 5]; + let mut buf = [0;5]; read(fd2, &mut buf).unwrap(); assert_eq!(&buf[..], b"hello"); } -#[test] -pub fn test_std_conversions() { - use nix::sys::socket::*; - - let std_sa = SocketAddrV4::from_str("127.0.0.1:6789").unwrap(); - let sock_addr = SockaddrIn::from(std_sa); - assert_eq!(std_sa, sock_addr.into()); - - let std_sa = SocketAddrV6::from_str("[::1]:6000").unwrap(); - let sock_addr: SockaddrIn6 = SockaddrIn6::from(std_sa); - assert_eq!(std_sa, sock_addr.into()); -} - mod recvfrom { - use super::*; + use nix::Result; use nix::sys::socket::*; - use nix::{errno::Errno, Result}; use std::thread; + use super::*; const MSG: &[u8] = b"Hello, World!"; - fn sendrecv( - rsock: RawFd, - ssock: RawFd, - f_send: Fs, - mut f_recv: Fr, - ) -> Option - where - Fs: Fn(RawFd, &[u8], MsgFlags) -> Result + Send + 'static, - Fr: FnMut(usize, Option), + fn sendrecv(rsock: RawFd, ssock: RawFd, f_send: Fs, mut f_recv: Fr) -> Option + where + Fs: Fn(RawFd, &[u8], MsgFlags) -> Result + Send + 'static, + Fr: FnMut(usize, Option), { let mut buf: [u8; 13] = [0u8; 13]; let mut l = 0; @@ -337,42 +294,33 @@ mod recvfrom { #[test] pub fn stream() { - let (fd2, fd1) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd2, fd1) = socketpair(AddressFamily::Unix, SockType::Stream, + None, SockFlag::empty()).unwrap(); // Ignore from for stream sockets - let _ = sendrecv(fd1, fd2, send, |_, _| {}); + let _ = sendrecv(fd1, fd2, |s, m, flags| { + send(s, m, flags) + }, |_, _| {}); } #[test] pub fn udp() { let std_sa = SocketAddrV4::from_str("127.0.0.1:6789").unwrap(); let sock_addr = SockaddrIn::from(std_sa); - let rsock = socket( - AddressFamily::Inet, + let rsock = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None + ).unwrap(); bind(rsock, &sock_addr).unwrap(); let ssock = socket( AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); - let from = sendrecv( - rsock, - ssock, - move |s, m, flags| sendto(s, m, &sock_addr, flags), - |_, _| {}, - ); + ).expect("send socket failed"); + let from = sendrecv(rsock, ssock, move |s, m, flags| { + sendto(s, m, &sock_addr, flags) + },|_, _| {}); // UDP sockets should set the from address assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); } @@ -396,13 +344,11 @@ mod recvfrom { let segment_size: u16 = 2; let sock_addr = SockaddrIn::new(127, 0, 0, 1, 6791); - let rsock = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); setsockopt(rsock, UdpGsoSegment, &(segment_size as _)) .expect("setsockopt UDP_SEGMENT failed"); @@ -413,30 +359,24 @@ mod recvfrom { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); + ).expect("send socket failed"); let mut num_packets_received: i32 = 0; - sendrecv( - rsock, - ssock, - move |s, m, flags| { - let iov = [IoSlice::new(m)]; - let cmsg = ControlMessage::UdpGsoSegments(&segment_size); - sendmsg(s, &iov, &[cmsg], flags, Some(&sock_addr)) - }, - { - let num_packets_received_ref = &mut num_packets_received; - - move |len, _| { - // check that we receive UDP packets with payload size - // less or equal to segment size - assert!(len <= segment_size as usize); - *num_packets_received_ref += 1; - } - }, - ); + sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let cmsg = ControlMessage::UdpGsoSegments(&segment_size); + sendmsg(s, &iov, &[cmsg], flags, Some(&sock_addr)) + }, { + let num_packets_received_ref = &mut num_packets_received; + + move |len, _| { + // check that we receive UDP packets with payload size + // less or equal to segment size + assert!(len <= segment_size as usize); + *num_packets_received_ref += 1; + } + }); // Buffer size is 13, we will receive six packets of size 2, // and one packet of size 1. @@ -453,13 +393,11 @@ mod recvfrom { // It's hard to guarantee receiving GRO packets. Just checking // that `setsockopt` doesn't fail with error - let rsock = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); setsockopt(rsock, UdpGroSegment, &true) .expect("setsockopt UDP_GRO failed"); @@ -481,54 +419,51 @@ mod recvfrom { let sock_addr = SockaddrIn::from(std_sa); let sock_addr2 = SockaddrIn::from(std_sa2); - let rsock = socket( - AddressFamily::Inet, + let rsock = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None + ).unwrap(); bind(rsock, &sock_addr).unwrap(); let ssock = socket( AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); + ).expect("send socket failed"); - let from = sendrecv( - rsock, - ssock, - move |s, m, flags| { - let iov = [IoSlice::new(m)]; - let mut msgs = vec![SendMmsgData { + let from = sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let mut msgs = vec![ + SendMmsgData { iov: &iov, cmsgs: &[], addr: Some(sock_addr), _lt: Default::default(), - }]; + } + ]; - let batch_size = 15; + let batch_size = 15; - for _ in 0..batch_size { - msgs.push(SendMmsgData { + for _ in 0..batch_size { + msgs.push( + SendMmsgData { iov: &iov, cmsgs: &[], addr: Some(sock_addr2), _lt: Default::default(), - }); - } - sendmmsg(s, msgs.iter(), flags).map(move |sent_bytes| { + } + ); + } + sendmmsg(s, msgs.iter(), flags) + .map(move |sent_bytes| { assert!(!sent_bytes.is_empty()); for sent in &sent_bytes { assert_eq!(*sent, m.len()); } sent_bytes.len() }) - }, - |_, _| {}, - ); + }, |_, _ | {}); // UDP sockets should set the from address assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); } @@ -541,35 +476,31 @@ mod recvfrom { ))] #[test] pub fn udp_recvmmsg() { - use nix::sys::socket::{recvmmsg, MsgFlags}; use std::io::IoSliceMut; + use nix::sys::socket::{MsgFlags, recvmmsg}; const NUM_MESSAGES_SENT: usize = 2; - const DATA: [u8; 2] = [1, 2]; + const DATA: [u8; 2] = [1,2]; let inet_addr = SocketAddrV4::from_str("127.0.0.1:6798").unwrap(); let sock_addr = SockaddrIn::from(inet_addr); - let rsock = socket( - AddressFamily::Inet, + let rsock = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None + ).unwrap(); bind(rsock, &sock_addr).unwrap(); let ssock = socket( AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); + ).expect("send socket failed"); let send_thread = thread::spawn(move || { for _ in 0..NUM_MESSAGES_SENT { - sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()) - .unwrap(); + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); } }); @@ -577,21 +508,18 @@ mod recvfrom { // Buffers to receive exactly `NUM_MESSAGES_SENT` messages let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT]; - let iovs: Vec<_> = receive_buffers - .iter_mut() - .map(|buf| [IoSliceMut::new(&mut buf[..])]) - .collect(); + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoSliceMut::new(&mut buf[..])] + }).collect(); for iov in &iovs { msgs.push_back(RecvMmsgData { iov, cmsg_buffer: None, }) - } + }; - let res: Vec> = - recvmmsg(rsock, &mut msgs, MsgFlags::empty(), None) - .expect("recvmmsg"); + let res: Vec> = recvmmsg(rsock, &mut msgs, MsgFlags::empty(), None).expect("recvmmsg"); assert_eq!(res.len(), DATA.len()); for RecvMsg { address, bytes, .. } in res.into_iter() { @@ -614,35 +542,31 @@ mod recvfrom { ))] #[test] pub fn udp_recvmmsg_dontwait_short_read() { - use nix::sys::socket::{recvmmsg, MsgFlags}; + use nix::sys::socket::{MsgFlags, recvmmsg}; use std::io::IoSliceMut; const NUM_MESSAGES_SENT: usize = 2; - const DATA: [u8; 4] = [1, 2, 3, 4]; + const DATA: [u8; 4] = [1,2,3,4]; let inet_addr = SocketAddrV4::from_str("127.0.0.1:6799").unwrap(); let sock_addr = SockaddrIn::from(inet_addr); - let rsock = socket( - AddressFamily::Inet, + let rsock = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None + ).unwrap(); bind(rsock, &sock_addr).unwrap(); let ssock = socket( AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); + ).expect("send socket failed"); let send_thread = thread::spawn(move || { for _ in 0..NUM_MESSAGES_SENT { - sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()) - .unwrap(); + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); } }); // Ensure we've sent all the messages before continuing so `recvmmsg` @@ -655,21 +579,18 @@ mod recvfrom { // will return when there are fewer than requested messages in the // kernel buffers when using `MSG_DONTWAIT`. let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT + 2]; - let iovs: Vec<_> = receive_buffers - .iter_mut() - .map(|buf| [IoSliceMut::new(&mut buf[..])]) - .collect(); + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoSliceMut::new(&mut buf[..])] + }).collect(); for iov in &iovs { msgs.push_back(RecvMmsgData { iov, cmsg_buffer: None, }) - } + }; - let res: Vec> = - recvmmsg(rsock, &mut msgs, MsgFlags::MSG_DONTWAIT, None) - .expect("recvmmsg"); + let res: Vec> = recvmmsg(rsock, &mut msgs, MsgFlags::MSG_DONTWAIT, None).expect("recvmmsg"); assert_eq!(res.len(), NUM_MESSAGES_SENT); for RecvMsg { address, bytes, .. } in res.into_iter() { @@ -681,64 +602,19 @@ mod recvfrom { assert_eq!(&buf[..DATA.len()], DATA); } } - - #[test] - pub fn udp_inet6() { - let addr = std::net::Ipv6Addr::from_str("::1").unwrap(); - let rport = 6789; - let rstd_sa = SocketAddrV6::new(addr, rport, 0, 0); - let raddr = SockaddrIn6::from(rstd_sa); - let sport = 6790; - let sstd_sa = SocketAddrV6::new(addr, sport, 0, 0); - let saddr = SockaddrIn6::from(sstd_sa); - let rsock = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("receive socket failed"); - match bind(rsock, &raddr) { - Err(Errno::EADDRNOTAVAIL) => { - println!("IPv6 not available, skipping test."); - return; - } - Err(e) => panic!("bind: {}", e), - Ok(()) => (), - } - let ssock = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("send socket failed"); - bind(ssock, &saddr).unwrap(); - let from = sendrecv( - rsock, - ssock, - move |s, m, flags| sendto(s, m, &raddr, flags), - |_, _| {}, - ); - assert_eq!(AddressFamily::Inet6, from.unwrap().family().unwrap()); - let osent_addr = from.unwrap(); - let sent_addr = osent_addr.as_sockaddr_in6().unwrap(); - assert_eq!(sent_addr.ip(), addr); - assert_eq!(sent_addr.port(), sport); - } } // Test error handling of our recvmsg wrapper #[test] pub fn test_recvmsg_ebadf() { use nix::errno::Errno; - use nix::sys::socket::{recvmsg, MsgFlags}; + use nix::sys::socket::{MsgFlags, recvmsg}; use std::io::IoSliceMut; let mut buf = [0u8; 5]; let mut iov = [IoSliceMut::new(&mut buf[..])]; - let fd = -1; // Bad file descriptor + let fd = -1; // Bad file descriptor let r = recvmsg::<()>(fd, &mut iov, None, MsgFlags::empty()); assert_eq!(r.err().unwrap(), Errno::EBADF); @@ -749,20 +625,14 @@ pub fn test_recvmsg_ebadf() { #[cfg_attr(qemu, ignore)] #[test] pub fn test_scm_rights() { - use nix::sys::socket::{ - recvmsg, sendmsg, socketpair, AddressFamily, ControlMessage, - ControlMessageOwned, MsgFlags, SockFlag, SockType, - }; - use nix::unistd::{close, pipe, read, write}; + use nix::unistd::{pipe, read, write, close}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; use std::io::{IoSlice, IoSliceMut}; - let (fd1, fd2) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); let (r, w) = pipe().unwrap(); let mut received_r: Option = None; @@ -770,10 +640,7 @@ pub fn test_scm_rights() { let iov = [IoSlice::new(b"hello")]; let fds = [r]; let cmsg = ControlMessage::ScmRights(&fds); - assert_eq!( - sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), - 5 - ); + assert_eq!(sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); close(r).unwrap(); close(fd1).unwrap(); } @@ -783,13 +650,7 @@ pub fn test_scm_rights() { let mut iov = [IoSliceMut::new(&mut buf[..])]; let mut cmsgspace = cmsg_space!([RawFd; 1]); - let msg = recvmsg::<()>( - fd2, - &mut iov, - Some(&mut cmsgspace), - MsgFlags::empty(), - ) - .unwrap(); + let msg = recvmsg::<()>(fd2, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); for cmsg in msg.cmsgs() { if let ControlMessageOwned::ScmRights(fd) = cmsg { @@ -801,9 +662,7 @@ pub fn test_scm_rights() { } } assert_eq!(msg.bytes, 5); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); close(fd2).unwrap(); } @@ -818,16 +677,15 @@ pub fn test_scm_rights() { } // Disable the test on emulated platforms due to not enabled support of AF_ALG in QEMU from rust cross -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(target_os = "linux", target_os= "android"))] #[cfg_attr(qemu, ignore)] #[test] pub fn test_af_alg_cipher() { - use nix::sys::socket::sockopt::AlgSetKey; - use nix::sys::socket::{ - accept, bind, sendmsg, setsockopt, socket, AddressFamily, AlgAddr, - ControlMessage, MsgFlags, SockFlag, SockType, - }; use nix::unistd::read; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, AlgAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::AlgSetKey; use std::io::IoSlice; skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); @@ -846,13 +704,8 @@ pub fn test_af_alg_cipher() { let payload_len = 256; let payload = vec![2u8; payload_len]; - let sock = socket( - AddressFamily::Alg, - SockType::SeqPacket, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); let sockaddr = AlgAddr::new(alg_type, alg_name); bind(sock, &sockaddr).expect("bind failed"); @@ -863,13 +716,9 @@ pub fn test_af_alg_cipher() { setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt"); let session_socket = accept(sock).expect("accept failed"); - let msgs = [ - ControlMessage::AlgSetOp(&libc::ALG_OP_ENCRYPT), - ControlMessage::AlgSetIv(iv.as_slice()), - ]; + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_ENCRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; let iov = IoSlice::new(&payload); - sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) - .expect("sendmsg encrypt"); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); // allocate buffer for encrypted data let mut encrypted = vec![0u8; payload_len]; @@ -880,12 +729,8 @@ pub fn test_af_alg_cipher() { let iv = vec![1u8; iv_len]; - let msgs = [ - ControlMessage::AlgSetOp(&libc::ALG_OP_DECRYPT), - ControlMessage::AlgSetIv(iv.as_slice()), - ]; - sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) - .expect("sendmsg decrypt"); + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_DECRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); // allocate buffer for decrypted data let mut decrypted = vec![0u8; payload_len]; @@ -897,18 +742,17 @@ pub fn test_af_alg_cipher() { // Disable the test on emulated platforms due to not enabled support of AF_ALG // in QEMU from rust cross -#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg(any(target_os = "linux", target_os= "android"))] #[cfg_attr(qemu, ignore)] #[test] pub fn test_af_alg_aead() { use libc::{ALG_OP_DECRYPT, ALG_OP_ENCRYPT}; use nix::fcntl::{fcntl, FcntlArg, OFlag}; - use nix::sys::socket::sockopt::{AlgSetAeadAuthSize, AlgSetKey}; - use nix::sys::socket::{ - accept, bind, sendmsg, setsockopt, socket, AddressFamily, AlgAddr, - ControlMessage, MsgFlags, SockFlag, SockType, - }; - use nix::unistd::{close, read}; + use nix::unistd::{read, close}; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, AlgAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::{AlgSetKey, AlgSetAeadAuthSize}; use std::io::IoSlice; skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); @@ -928,8 +772,7 @@ pub fn test_af_alg_aead() { let iv = vec![1u8; iv_len]; // 256-bytes plain payload let payload_len = 256; - let mut payload = - vec![2u8; payload_len + (assoc_size as usize) + auth_size]; + let mut payload = vec![2u8; payload_len + (assoc_size as usize) + auth_size]; for i in 0..assoc_size { payload[i as usize] = 10; @@ -941,35 +784,26 @@ pub fn test_af_alg_aead() { payload[len - 1 - i] = 0; } - let sock = socket( - AddressFamily::Alg, - SockType::SeqPacket, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); let sockaddr = AlgAddr::new(alg_type, alg_name); bind(sock, &sockaddr).expect("bind failed"); - setsockopt(sock, AlgSetAeadAuthSize, &auth_size) - .expect("setsockopt AlgSetAeadAuthSize"); + setsockopt(sock, AlgSetAeadAuthSize, &auth_size).expect("setsockopt AlgSetAeadAuthSize"); setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt AlgSetKey"); let session_socket = accept(sock).expect("accept failed"); let msgs = [ ControlMessage::AlgSetOp(&ALG_OP_ENCRYPT), ControlMessage::AlgSetIv(iv.as_slice()), - ControlMessage::AlgSetAeadAssoclen(&assoc_size), - ]; + ControlMessage::AlgSetAeadAssoclen(&assoc_size)]; let iov = IoSlice::new(&payload); - sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) - .expect("sendmsg encrypt"); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); // allocate buffer for encrypted data - let mut encrypted = - vec![0u8; (assoc_size as usize) + payload_len + auth_size]; + let mut encrypted = vec![0u8; (assoc_size as usize) + payload_len + auth_size]; let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); assert_eq!(num_bytes, payload_len + auth_size + (assoc_size as usize)); close(session_socket).expect("close"); @@ -989,25 +823,19 @@ pub fn test_af_alg_aead() { ControlMessage::AlgSetIv(iv.as_slice()), ControlMessage::AlgSetAeadAssoclen(&assoc_size), ]; - sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) - .expect("sendmsg decrypt"); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); // allocate buffer for decrypted data - let mut decrypted = - vec![0u8; payload_len + (assoc_size as usize) + auth_size]; + let mut decrypted = vec![0u8; payload_len + (assoc_size as usize) + auth_size]; // Starting with kernel 4.9, the interface changed slightly such that the // authentication tag memory is only needed in the output buffer for encryption // and in the input buffer for decryption. // Do not block on read, as we may have fewer bytes than buffer size - fcntl(session_socket, FcntlArg::F_SETFL(OFlag::O_NONBLOCK)) - .expect("fcntl non_blocking"); + fcntl(session_socket,FcntlArg::F_SETFL(OFlag::O_NONBLOCK)).expect("fcntl non_blocking"); let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); assert!(num_bytes >= payload_len + (assoc_size as usize)); - assert_eq!( - decrypted[(assoc_size as usize)..(payload_len + (assoc_size as usize))], - payload[(assoc_size as usize)..payload_len + (assoc_size as usize)] - ); + assert_eq!(decrypted[(assoc_size as usize)..(payload_len + (assoc_size as usize))], payload[(assoc_size as usize)..payload_len + (assoc_size as usize)]); } // Verify `ControlMessage::Ipv4PacketInfo` for `sendmsg`. @@ -1017,25 +845,24 @@ pub fn test_af_alg_aead() { // This would be a more interesting test if we could assume that the test host // has more than one IP address (since we could select a different address to // test from). -#[cfg(any(target_os = "linux", target_os = "macos", target_os = "netbsd"))] +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd"))] #[test] pub fn test_sendmsg_ipv4packetinfo() { use cfg_if::cfg_if; - use nix::sys::socket::{ - bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, - SockFlag, SockType, SockaddrIn, - }; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockaddrIn, + ControlMessage, MsgFlags}; use std::io::IoSlice; - let sock = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let sock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); - let sock_addr = SockaddrIn::new(127, 0, 0, 1, 4000); + let sock_addr = SockaddrIn::new(127,0,0,1, 4000); bind(sock, &sock_addr).expect("bind failed"); @@ -1071,28 +898,23 @@ pub fn test_sendmsg_ipv4packetinfo() { // This would be a more interesting test if we could assume that the test host // has more than one IP address (since we could select a different address to // test from). -#[cfg(any( - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "freebsd" -))] +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd"))] #[test] pub fn test_sendmsg_ipv6packetinfo() { use nix::errno::Errno; - use nix::sys::socket::{ - bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, - SockFlag, SockType, SockaddrIn6, - }; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockaddrIn6, + ControlMessage, MsgFlags}; use std::io::IoSlice; - let sock = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let sock = socket(AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); let std_sa = SocketAddrV6::from_str("[::1]:6000").unwrap(); let sock_addr: SockaddrIn6 = SockaddrIn6::from(std_sa); @@ -1112,66 +934,8 @@ pub fn test_sendmsg_ipv6packetinfo() { let cmsg = [ControlMessage::Ipv6PacketInfo(&pi)]; - sendmsg::( - sock, - &iov, - &cmsg, - MsgFlags::empty(), - Some(&sock_addr), - ) - .expect("sendmsg"); -} - -// Verify that ControlMessage::Ipv4SendSrcAddr works for sendmsg. This -// creates a UDP socket bound to all local interfaces (0.0.0.0). It then -// sends message to itself at 127.0.0.1 while explicitly specifying -// 127.0.0.1 as the source address through an Ipv4SendSrcAddr -// (IP_SENDSRCADDR) control message. -// -// Note that binding to 0.0.0.0 is *required* on FreeBSD; sendmsg -// returns EINVAL otherwise. (See FreeBSD's ip(4) man page.) -#[cfg(any( - target_os = "netbsd", - target_os = "freebsd", - target_os = "openbsd", - target_os = "dragonfly", -))] -#[test] -pub fn test_sendmsg_ipv4sendsrcaddr() { - use nix::sys::socket::{ - bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, - SockFlag, SockType, SockaddrIn, - }; - use std::io::IoSlice; - - let sock = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("socket failed"); - - let unspec_sock_addr = SockaddrIn::new(0, 0, 0, 0, 0); - bind(sock, &unspec_sock_addr).expect("bind failed"); - let bound_sock_addr: SockaddrIn = getsockname(sock).unwrap(); - let localhost_sock_addr: SockaddrIn = - SockaddrIn::new(127, 0, 0, 1, bound_sock_addr.port()); - - let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; - let iov = [IoSlice::new(&slice)]; - let cmsg = [ControlMessage::Ipv4SendSrcAddr( - &localhost_sock_addr.as_ref().sin_addr, - )]; - - sendmsg( - sock, - &iov, - &cmsg, - MsgFlags::empty(), - Some(&localhost_sock_addr), - ) - .expect("sendmsg"); + sendmsg::(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); } /// Tests that passing multiple fds using a single `ControlMessage` works. @@ -1180,13 +944,12 @@ pub fn test_sendmsg_ipv4sendsrcaddr() { #[cfg_attr(qemu, ignore)] #[test] fn test_scm_rights_single_cmsg_multiple_fds() { - use nix::sys::socket::{ - recvmsg, sendmsg, ControlMessage, ControlMessageOwned, MsgFlags, - }; - use std::io::{IoSlice, IoSliceMut}; - use std::os::unix::io::{AsRawFd, RawFd}; use std::os::unix::net::UnixDatagram; + use std::os::unix::io::{RawFd, AsRawFd}; use std::thread; + use nix::sys::socket::{ControlMessage, ControlMessageOwned, MsgFlags, + sendmsg, recvmsg}; + use std::io::{IoSlice, IoSliceMut}; let (send, receive) = UnixDatagram::pair().unwrap(); let thread = thread::spawn(move || { @@ -1198,23 +961,17 @@ fn test_scm_rights_single_cmsg_multiple_fds() { receive.as_raw_fd(), &mut iovec, Some(&mut space), - MsgFlags::empty(), - ) - .unwrap(); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + MsgFlags::empty() + ).unwrap(); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); let mut cmsgs = msg.cmsgs(); match cmsgs.next() { Some(ControlMessageOwned::ScmRights(fds)) => { - assert_eq!( - fds.len(), - 2, - "unexpected fd count (expected 2 fds, got {})", - fds.len() - ); - } + assert_eq!(fds.len(), 2, + "unexpected fd count (expected 2 fds, got {})", + fds.len()); + }, _ => panic!(), } assert!(cmsgs.next().is_none(), "unexpected control msg"); @@ -1225,10 +982,9 @@ fn test_scm_rights_single_cmsg_multiple_fds() { let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; let iov = [IoSlice::new(&slice)]; - let fds = [libc::STDIN_FILENO, libc::STDOUT_FILENO]; // pass stdin and stdout + let fds = [libc::STDIN_FILENO, libc::STDOUT_FILENO]; // pass stdin and stdout let cmsg = [ControlMessage::ScmRights(&fds)]; - sendmsg::<()>(send.as_raw_fd(), &iov, &cmsg, MsgFlags::empty(), None) - .unwrap(); + sendmsg::<()>(send.as_raw_fd(), &iov, &cmsg, MsgFlags::empty(), None).unwrap(); thread.join().unwrap(); } @@ -1238,27 +994,17 @@ fn test_scm_rights_single_cmsg_multiple_fds() { // raw `sendmsg`. #[test] pub fn test_sendmsg_empty_cmsgs() { - use nix::sys::socket::{ - recvmsg, sendmsg, socketpair, AddressFamily, MsgFlags, SockFlag, - SockType, - }; use nix::unistd::close; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, MsgFlags}; use std::io::{IoSlice, IoSliceMut}; - let (fd1, fd2) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); { let iov = [IoSlice::new(b"hello")]; - assert_eq!( - sendmsg::<()>(fd1, &iov, &[], MsgFlags::empty(), None).unwrap(), - 5 - ); + assert_eq!(sendmsg::<()>(fd1, &iov, &[], MsgFlags::empty(), None).unwrap(), 5); close(fd1).unwrap(); } @@ -1267,20 +1013,12 @@ pub fn test_sendmsg_empty_cmsgs() { let mut iov = [IoSliceMut::new(&mut buf[..])]; let mut cmsgspace = cmsg_space!([RawFd; 1]); - let msg = recvmsg::<()>( - fd2, - &mut iov, - Some(&mut cmsgspace), - MsgFlags::empty(), - ) - .unwrap(); + let msg = recvmsg::<()>(fd2, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); for _ in msg.cmsgs() { panic!("unexpected cmsg"); } - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); assert_eq!(msg.bytes, 5); close(fd2).unwrap(); } @@ -1294,22 +1032,17 @@ pub fn test_sendmsg_empty_cmsgs() { ))] #[test] fn test_scm_credentials() { - use nix::sys::socket::{ - recvmsg, sendmsg, socketpair, AddressFamily, ControlMessage, - ControlMessageOwned, MsgFlags, SockFlag, SockType, UnixCredentials, - }; + use nix::unistd::{close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags, + UnixCredentials}; #[cfg(any(target_os = "android", target_os = "linux"))] use nix::sys::socket::{setsockopt, sockopt::PassCred}; - use nix::unistd::{close, getgid, getpid, getuid}; use std::io::{IoSlice, IoSliceMut}; - let (send, recv) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); #[cfg(any(target_os = "android", target_os = "linux"))] setsockopt(recv, PassCred, &true).unwrap(); @@ -1321,11 +1054,7 @@ fn test_scm_credentials() { let cmsg = ControlMessage::ScmCredentials(&cred); #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] let cmsg = ControlMessage::ScmCreds; - assert_eq!( - sendmsg::<()>(send, &iov, &[cmsg], MsgFlags::empty(), None) - .unwrap(), - 5 - ); + assert_eq!(sendmsg::<()>(send, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); close(send).unwrap(); } @@ -1334,13 +1063,7 @@ fn test_scm_credentials() { let mut iov = [IoSliceMut::new(&mut buf[..])]; let mut cmsgspace = cmsg_space!(UnixCredentials); - let msg = recvmsg::<()>( - recv, - &mut iov, - Some(&mut cmsgspace), - MsgFlags::empty(), - ) - .unwrap(); + let msg = recvmsg::<()>(recv, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); let mut received_cred = None; for cmsg in msg.cmsgs() { @@ -1359,9 +1082,7 @@ fn test_scm_credentials() { } received_cred.expect("no creds received"); assert_eq!(msg.bytes, 5); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); close(recv).unwrap(); } } @@ -1393,21 +1114,15 @@ fn test_too_large_cmsgspace() { #[cfg(any(target_os = "android", target_os = "linux"))] fn test_impl_scm_credentials_and_rights(mut space: Vec) { use libc::ucred; + use nix::unistd::{pipe, write, close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, setsockopt, + SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; use nix::sys::socket::sockopt::PassCred; - use nix::sys::socket::{ - recvmsg, sendmsg, setsockopt, socketpair, ControlMessage, - ControlMessageOwned, MsgFlags, SockFlag, SockType, - }; - use nix::unistd::{close, getgid, getpid, getuid, pipe, write}; use std::io::{IoSlice, IoSliceMut}; - let (send, recv) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); setsockopt(recv, PassCred, &true).unwrap(); let (r, w) = pipe().unwrap(); @@ -1419,17 +1134,13 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec) { pid: getpid().as_raw(), uid: getuid().as_raw(), gid: getgid().as_raw(), - } - .into(); + }.into(); let fds = [r]; let cmsgs = [ ControlMessage::ScmCredentials(&cred), ControlMessage::ScmRights(&fds), ]; - assert_eq!( - sendmsg::<()>(send, &iov, &cmsgs, MsgFlags::empty(), None).unwrap(), - 5 - ); + assert_eq!(sendmsg::<()>(send, &iov, &cmsgs, MsgFlags::empty(), None).unwrap(), 5); close(r).unwrap(); close(send).unwrap(); } @@ -1437,9 +1148,7 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec) { { let mut buf = [0u8; 5]; let mut iov = [IoSliceMut::new(&mut buf[..])]; - let msg = - recvmsg::<()>(recv, &mut iov, Some(&mut space), MsgFlags::empty()) - .unwrap(); + let msg = recvmsg::<()>(recv, &mut iov, Some(&mut space), MsgFlags::empty()).unwrap(); let mut received_cred = None; assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); @@ -1463,9 +1172,7 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec) { } received_cred.expect("no creds received"); assert_eq!(msg.bytes, 5); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); close(recv).unwrap(); } @@ -1482,32 +1189,22 @@ fn test_impl_scm_credentials_and_rights(mut space: Vec) { // Test creating and using named unix domain sockets #[test] pub fn test_unixdomain() { - use nix::sys::socket::{accept, bind, connect, listen, socket, UnixAddr}; - use nix::sys::socket::{SockFlag, SockType}; - use nix::unistd::{close, read, write}; + use nix::sys::socket::{SockType, SockFlag}; + use nix::sys::socket::{bind, socket, connect, listen, accept, UnixAddr}; + use nix::unistd::{read, write, close}; use std::thread; let tempdir = tempfile::tempdir().unwrap(); let sockname = tempdir.path().join("sock"); - let s1 = socket( - AddressFamily::Unix, - SockType::Stream, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let s1 = socket(AddressFamily::Unix, SockType::Stream, + SockFlag::empty(), None).expect("socket failed"); let sockaddr = UnixAddr::new(&sockname).unwrap(); bind(s1, &sockaddr).expect("bind failed"); listen(s1, 10).expect("listen failed"); let thr = thread::spawn(move || { - let s2 = socket( - AddressFamily::Unix, - SockType::Stream, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let s2 = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); connect(s2, &sockaddr).expect("connect failed"); write(s2, b"hello").expect("write failed"); close(s2).unwrap(); @@ -1515,7 +1212,7 @@ pub fn test_unixdomain() { let s3 = accept(s1).expect("accept failed"); - let mut buf = [0; 5]; + let mut buf = [0;5]; read(s3, &mut buf).unwrap(); close(s3).unwrap(); close(s1).unwrap(); @@ -1529,23 +1226,14 @@ pub fn test_unixdomain() { #[test] pub fn test_syscontrol() { use nix::errno::Errno; - use nix::sys::socket::{ - socket, SockFlag, SockProtocol, SockType, SysControlAddr, - }; + use nix::sys::socket::{socket, SysControlAddr, SockType, SockFlag, SockProtocol}; - let fd = socket( - AddressFamily::System, - SockType::Datagram, - SockFlag::empty(), - SockProtocol::KextControl, - ) - .expect("socket failed"); + let fd = socket(AddressFamily::System, SockType::Datagram, + SockFlag::empty(), SockProtocol::KextControl) + .expect("socket failed"); SysControlAddr::from_name(fd, "com.apple.net.utun_control", 0) .expect("resolving sys_control name failed"); - assert_eq!( - SysControlAddr::from_name(fd, "foo.bar.lol", 0).err(), - Some(Errno::ENOENT) - ); + assert_eq!(SysControlAddr::from_name(fd, "foo.bar.lol", 0).err(), Some(Errno::ENOENT)); // requires root privileges // connect(fd, &sockaddr).expect("connect failed"); @@ -1560,30 +1248,31 @@ pub fn test_syscontrol() { target_os = "netbsd", target_os = "openbsd", ))] -fn loopback_address( - family: AddressFamily, -) -> Option { +fn loopback_address(family: AddressFamily) -> Option { + use std::io; + use std::io::Write; use nix::ifaddrs::getifaddrs; use nix::net::if_::*; use nix::sys::socket::SockaddrLike; - use std::io; - use std::io::Write; - let mut addrs = match getifaddrs() { + let addrs = match getifaddrs() { Ok(iter) => iter, Err(e) => { let stdioerr = io::stderr(); let mut handle = stdioerr.lock(); writeln!(handle, "getifaddrs: {:?}", e).unwrap(); return None; - } + }, }; // return first address matching family - addrs.find(|ifaddr| { - ifaddr.flags.contains(InterfaceFlags::IFF_LOOPBACK) - && ifaddr.address.as_ref().and_then(SockaddrLike::family) - == Some(family) - }) + for ifaddr in addrs { + if ifaddr.flags.contains(InterfaceFlags::IFF_LOOPBACK) && + ifaddr.address.as_ref().and_then(SockaddrLike::family) == Some(family) + { + return Some(ifaddr) + } + } + None } #[cfg(any( @@ -1594,41 +1283,35 @@ fn loopback_address( target_os = "netbsd", ))] // qemu doesn't seem to be emulating this correctly in these architectures -#[cfg_attr( - all( - qemu, - any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc64", - ) - ), - ignore -)] +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] #[test] pub fn test_recv_ipv4pktinfo() { - use nix::net::if_::*; use nix::sys::socket::sockopt::Ipv4PacketInfo; - use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; + use nix::sys::socket::{bind, SockaddrIn, SockFlag, SockType}; use nix::sys::socket::{getsockname, setsockopt, socket}; use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use nix::net::if_::*; use std::io::{IoSlice, IoSliceMut}; let lo_ifaddr = loopback_address(AddressFamily::Inet); let (lo_name, lo) = match lo_ifaddr { - Some(ifaddr) => ( - ifaddr.interface_name, - ifaddr.address.expect("Expect IPv4 address on interface"), - ), + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), None => return, }; let receive = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("receive socket failed"); + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); bind(receive, &lo).expect("bind failed"); let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); setsockopt(receive, Ipv4PacketInfo, &true).expect("setsockopt failed"); @@ -1642,10 +1325,8 @@ pub fn test_recv_ipv4pktinfo() { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); - sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) - .expect("sendmsg failed"); + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); } { @@ -1658,25 +1339,29 @@ pub fn test_recv_ipv4pktinfo() { &mut iovec, Some(&mut space), MsgFlags::empty(), - ) - .expect("recvmsg failed"); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); let mut cmsgs = msg.cmsgs(); - if let Some(ControlMessageOwned::Ipv4PacketInfo(pktinfo)) = cmsgs.next() - { + if let Some(ControlMessageOwned::Ipv4PacketInfo(pktinfo)) = cmsgs.next() { let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); assert_eq!( - pktinfo.ipi_ifindex as libc::c_uint, i, + pktinfo.ipi_ifindex as libc::c_uint, + i, "unexpected ifindex (expected {}, got {})", - i, pktinfo.ipi_ifindex + i, + pktinfo.ipi_ifindex ); } assert!(cmsgs.next().is_none(), "unexpected additional control msg"); assert_eq!(msg.bytes, 8); - assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); } } @@ -1688,32 +1373,27 @@ pub fn test_recv_ipv4pktinfo() { target_os = "openbsd", ))] // qemu doesn't seem to be emulating this correctly in these architectures -#[cfg_attr( - all( - qemu, - any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc64", - ) - ), - ignore -)] +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] #[test] pub fn test_recvif() { use nix::net::if_::*; - use nix::sys::socket::sockopt::{Ipv4RecvDstAddr, Ipv4RecvIf}; - use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; + use nix::sys::socket::sockopt::{Ipv4RecvIf, Ipv4RecvDstAddr}; + use nix::sys::socket::{bind, SockaddrIn, SockFlag, SockType}; use nix::sys::socket::{getsockname, setsockopt, socket}; use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; use std::io::{IoSlice, IoSliceMut}; let lo_ifaddr = loopback_address(AddressFamily::Inet); let (lo_name, lo) = match lo_ifaddr { - Some(ifaddr) => ( - ifaddr.interface_name, - ifaddr.address.expect("Expect IPv4 address on interface"), - ), + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), None => return, }; let receive = socket( @@ -1721,14 +1401,11 @@ pub fn test_recvif() { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("receive socket failed"); + ).expect("receive socket failed"); bind(receive, &lo).expect("bind failed"); let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); - setsockopt(receive, Ipv4RecvIf, &true) - .expect("setsockopt IP_RECVIF failed"); - setsockopt(receive, Ipv4RecvDstAddr, &true) - .expect("setsockopt IP_RECVDSTADDR failed"); + setsockopt(receive, Ipv4RecvIf, &true).expect("setsockopt IP_RECVIF failed"); + setsockopt(receive, Ipv4RecvDstAddr, &true).expect("setsockopt IP_RECVDSTADDR failed"); { let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; @@ -1739,10 +1416,8 @@ pub fn test_recvif() { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); - sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) - .expect("sendmsg failed"); + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); } { @@ -1754,11 +1429,11 @@ pub fn test_recvif() { &mut iovec, Some(&mut space), MsgFlags::empty(), - ) - .expect("recvmsg failed"); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); let mut rx_recvif = false; @@ -1767,14 +1442,15 @@ pub fn test_recvif() { match cmsg { ControlMessageOwned::Ipv4RecvIf(dl) => { rx_recvif = true; - let i = if_nametoindex(lo_name.as_bytes()) - .expect("if_nametoindex"); + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); assert_eq!( - dl.sdl_index as libc::c_uint, i, + dl.sdl_index as libc::c_uint, + i, "unexpected ifindex (expected {}, got {})", - i, dl.sdl_index + i, + dl.sdl_index ); - } + }, ControlMessageOwned::Ipv4RecvDstAddr(addr) => { rx_recvdstaddr = true; if let Some(sin) = lo.as_sockaddr_in() { @@ -1786,184 +1462,17 @@ pub fn test_recvif() { } else { panic!("unexpected Sockaddr"); } - } + }, _ => panic!("unexpected additional control msg"), } } assert!(rx_recvif); assert!(rx_recvdstaddr); assert_eq!(msg.bytes, 8); - assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); - } -} - -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] -#[cfg_attr(qemu, ignore)] -#[test] -pub fn test_recvif_ipv4() { - use nix::sys::socket::sockopt::Ipv4OrigDstAddr; - use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; - use nix::sys::socket::{getsockname, setsockopt, socket}; - use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; - use std::io::{IoSlice, IoSliceMut}; - - let lo_ifaddr = loopback_address(AddressFamily::Inet); - let (_lo_name, lo) = match lo_ifaddr { - Some(ifaddr) => ( - ifaddr.interface_name, - ifaddr.address.expect("Expect IPv4 address on interface"), - ), - None => return, - }; - let receive = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("receive socket failed"); - bind(receive, &lo).expect("bind failed"); - let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); - setsockopt(receive, Ipv4OrigDstAddr, &true) - .expect("setsockopt IP_ORIGDSTADDR failed"); - - { - let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; - let iov = [IoSlice::new(&slice)]; - - let send = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("send socket failed"); - sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) - .expect("sendmsg failed"); - } - - { - let mut buf = [0u8; 8]; - let mut iovec = [IoSliceMut::new(&mut buf)]; - let mut space = cmsg_space!(libc::sockaddr_in); - let msg = recvmsg::<()>( - receive, - &mut iovec, - Some(&mut space), - MsgFlags::empty(), - ) - .expect("recvmsg failed"); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); - assert_eq!(msg.cmsgs().count(), 1, "expected 1 cmsgs"); - - let mut rx_recvorigdstaddr = false; - for cmsg in msg.cmsgs() { - match cmsg { - ControlMessageOwned::Ipv4OrigDstAddr(addr) => { - rx_recvorigdstaddr = true; - if let Some(sin) = lo.as_sockaddr_in() { - assert_eq!(sin.as_ref().sin_addr.s_addr, - addr.sin_addr.s_addr, - "unexpected destination address (expected {}, got {})", - sin.as_ref().sin_addr.s_addr, - addr.sin_addr.s_addr); - } else { - panic!("unexpected Sockaddr"); - } - } - _ => panic!("unexpected additional control msg"), - } - } - assert!(rx_recvorigdstaddr); - assert_eq!(msg.bytes, 8); - assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); - } -} - -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] -#[cfg_attr(qemu, ignore)] -#[test] -pub fn test_recvif_ipv6() { - use nix::sys::socket::sockopt::Ipv6OrigDstAddr; - use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn6}; - use nix::sys::socket::{getsockname, setsockopt, socket}; - use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; - use std::io::{IoSlice, IoSliceMut}; - - let lo_ifaddr = loopback_address(AddressFamily::Inet6); - let (_lo_name, lo) = match lo_ifaddr { - Some(ifaddr) => ( - ifaddr.interface_name, - ifaddr.address.expect("Expect IPv6 address on interface"), - ), - None => return, - }; - let receive = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("receive socket failed"); - bind(receive, &lo).expect("bind failed"); - let sa: SockaddrIn6 = getsockname(receive).expect("getsockname failed"); - setsockopt(receive, Ipv6OrigDstAddr, &true) - .expect("setsockopt IP_ORIGDSTADDR failed"); - - { - let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; - let iov = [IoSlice::new(&slice)]; - - let send = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .expect("send socket failed"); - sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) - .expect("sendmsg failed"); - } - - { - let mut buf = [0u8; 8]; - let mut iovec = [IoSliceMut::new(&mut buf)]; - let mut space = cmsg_space!(libc::sockaddr_in6); - let msg = recvmsg::<()>( - receive, - &mut iovec, - Some(&mut space), - MsgFlags::empty(), - ) - .expect("recvmsg failed"); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); - assert_eq!(msg.cmsgs().count(), 1, "expected 1 cmsgs"); - - let mut rx_recvorigdstaddr = false; - for cmsg in msg.cmsgs() { - match cmsg { - ControlMessageOwned::Ipv6OrigDstAddr(addr) => { - rx_recvorigdstaddr = true; - if let Some(sin) = lo.as_sockaddr_in6() { - assert_eq!(sin.as_ref().sin6_addr.s6_addr, - addr.sin6_addr.s6_addr, - "unexpected destination address (expected {:?}, got {:?})", - sin.as_ref().sin6_addr.s6_addr, - addr.sin6_addr.s6_addr); - } else { - panic!("unexpected Sockaddr"); - } - } - _ => panic!("unexpected additional control msg"), - } - } - assert!(rx_recvorigdstaddr); - assert_eq!(msg.bytes, 8); - assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); } } @@ -1977,32 +1486,27 @@ pub fn test_recvif_ipv6() { target_os = "openbsd", ))] // qemu doesn't seem to be emulating this correctly in these architectures -#[cfg_attr( - all( - qemu, - any( - target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc64", - ) - ), - ignore -)] +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] #[test] pub fn test_recv_ipv6pktinfo() { use nix::net::if_::*; use nix::sys::socket::sockopt::Ipv6RecvPacketInfo; - use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn6}; + use nix::sys::socket::{bind, SockaddrIn6, SockFlag, SockType}; use nix::sys::socket::{getsockname, setsockopt, socket}; use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; use std::io::{IoSlice, IoSliceMut}; let lo_ifaddr = loopback_address(AddressFamily::Inet6); let (lo_name, lo) = match lo_ifaddr { - Some(ifaddr) => ( - ifaddr.interface_name, - ifaddr.address.expect("Expect IPv6 address on interface"), - ), + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), None => return, }; let receive = socket( @@ -2010,8 +1514,7 @@ pub fn test_recv_ipv6pktinfo() { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("receive socket failed"); + ).expect("receive socket failed"); bind(receive, &lo).expect("bind failed"); let sa: SockaddrIn6 = getsockname(receive).expect("getsockname failed"); setsockopt(receive, Ipv6RecvPacketInfo, &true).expect("setsockopt failed"); @@ -2025,10 +1528,8 @@ pub fn test_recv_ipv6pktinfo() { SockType::Datagram, SockFlag::empty(), None, - ) - .expect("send socket failed"); - sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) - .expect("sendmsg failed"); + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); } { @@ -2041,25 +1542,30 @@ pub fn test_recv_ipv6pktinfo() { &mut iovec, Some(&mut space), MsgFlags::empty(), - ) - .expect("recvmsg failed"); - assert!(!msg - .flags - .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); let mut cmsgs = msg.cmsgs(); if let Some(ControlMessageOwned::Ipv6PacketInfo(pktinfo)) = cmsgs.next() { let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); assert_eq!( - pktinfo.ipi6_ifindex as libc::c_uint, i, + pktinfo.ipi6_ifindex as libc::c_uint, + i, "unexpected ifindex (expected {}, got {})", - i, pktinfo.ipi6_ifindex + i, + pktinfo.ipi6_ifindex ); } assert!(cmsgs.next().is_none(), "unexpected additional control msg"); assert_eq!(msg.bytes, 8); - assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); } } @@ -2068,26 +1574,21 @@ pub fn test_recv_ipv6pktinfo() { #[test] pub fn test_vsock() { use nix::errno::Errno; - use nix::sys::socket::{ - bind, connect, listen, socket, AddressFamily, SockFlag, SockType, - VsockAddr, - }; - use nix::unistd::close; + use nix::sys::socket::{AddressFamily, socket, bind, connect, listen, + SockType, SockFlag, VsockAddr}; + use nix::unistd::{close}; use std::thread; let port: u32 = 3000; - let s1 = socket( - AddressFamily::Vsock, - SockType::Stream, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let s1 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); // VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error. let sockaddr_hv = VsockAddr::new(libc::VMADDR_CID_HYPERVISOR, port); - assert_eq!(bind(s1, &sockaddr_hv).err(), Some(Errno::EADDRNOTAVAIL)); + assert_eq!(bind(s1, &sockaddr_hv).err(), + Some(Errno::EADDRNOTAVAIL)); let sockaddr_any = VsockAddr::new(libc::VMADDR_CID_ANY, port); assert_eq!(bind(s1, &sockaddr_any), Ok(())); @@ -2096,13 +1597,9 @@ pub fn test_vsock() { let thr = thread::spawn(move || { let cid: u32 = libc::VMADDR_CID_HOST; - let s2 = socket( - AddressFamily::Vsock, - SockType::Stream, - SockFlag::empty(), - None, - ) - .expect("socket failed"); + let s2 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); let sockaddr_host = VsockAddr::new(cid, port); @@ -2124,8 +1621,8 @@ pub fn test_vsock() { #[test] fn test_recvmsg_timestampns() { use nix::sys::socket::*; - use nix::sys::time::*; use std::io::{IoSlice, IoSliceMut}; + use nix::sys::time::*; use std::time::*; // Set up @@ -2134,9 +1631,7 @@ fn test_recvmsg_timestampns() { AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None).unwrap(); setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); let localhost = SockaddrIn::new(127, 0, 0, 1, 0); bind(in_socket, &localhost).unwrap(); @@ -2153,19 +1648,18 @@ fn test_recvmsg_timestampns() { let mut cmsgspace = nix::cmsg_space!(TimeSpec); let mut iov = [IoSliceMut::new(&mut buffer)]; - let r = recvmsg::<()>(in_socket, &mut iov, Some(&mut cmsgspace), flags) - .unwrap(); + let r = recvmsg::<()>(in_socket, &mut iov, Some(&mut cmsgspace), flags).unwrap(); let rtime = match r.cmsgs().next() { Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, Some(_) => panic!("Unexpected control message"), - None => panic!("No control message"), + None => panic!("No control message") }; // Check the final time let time1 = SystemTime::now(); // the packet's received timestamp should lie in-between the two system // times, unless the system clock was adjusted in the meantime. - let rduration = - Duration::new(rtime.tv_sec() as u64, rtime.tv_nsec() as u32); + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); // Close socket @@ -2179,8 +1673,8 @@ fn test_recvmsg_timestampns() { #[test] fn test_recvmmsg_timestampns() { use nix::sys::socket::*; - use nix::sys::time::*; use std::io::{IoSlice, IoSliceMut}; + use nix::sys::time::*; use std::time::*; // Set up @@ -2189,9 +1683,7 @@ fn test_recvmmsg_timestampns() { AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None).unwrap(); setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); bind(in_socket, &localhost).unwrap(); @@ -2207,23 +1699,24 @@ fn test_recvmmsg_timestampns() { let mut buffer = vec![0u8; message.len()]; let mut cmsgspace = nix::cmsg_space!(TimeSpec); let iov = [IoSliceMut::new(&mut buffer)]; - let mut data = vec![RecvMmsgData { - iov, - cmsg_buffer: Some(&mut cmsgspace), - }]; - let r: Vec> = - recvmmsg(in_socket, &mut data, flags, None).unwrap(); + let mut data = vec![ + RecvMmsgData { + iov, + cmsg_buffer: Some(&mut cmsgspace), + }, + ]; + let r: Vec> = recvmmsg(in_socket, &mut data, flags, None).unwrap(); let rtime = match r[0].cmsgs().next() { Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, Some(_) => panic!("Unexpected control message"), - None => panic!("No control message"), + None => panic!("No control message") }; // Check the final time let time1 = SystemTime::now(); // the packet's received timestamp should lie in-between the two system // times, unless the system clock was adjusted in the meantime. - let rduration = - Duration::new(rtime.tv_sec() as u64, rtime.tv_nsec() as u32); + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); // Close socket @@ -2236,10 +1729,10 @@ fn test_recvmmsg_timestampns() { #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] #[test] fn test_recvmsg_rxq_ovfl() { - use nix::sys::socket::sockopt::{RcvBuf, RxqOvfl}; - use nix::sys::socket::*; use nix::Error; + use nix::sys::socket::*; use std::io::{IoSlice, IoSliceMut}; + use nix::sys::socket::sockopt::{RxqOvfl, RcvBuf}; let message = [0u8; 2048]; let bufsize = message.len() * 2; @@ -2248,16 +1741,12 @@ fn test_recvmsg_rxq_ovfl() { AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None).unwrap(); let out_socket = socket( AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), - None, - ) - .unwrap(); + None).unwrap(); let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); bind(in_socket, &localhost).unwrap(); @@ -2280,8 +1769,7 @@ fn test_recvmsg_rxq_ovfl() { // Send the 3 messages (the receiver buffer can only hold 2 messages) // to create an overflow. for _ in 0..3 { - let l = - sendmsg(out_socket, &iov, &[], flags, Some(&address)).unwrap(); + let l = sendmsg(out_socket, &iov, &[], flags, Some(&address)).unwrap(); assert_eq!(message.len(), l); } @@ -2296,23 +1784,16 @@ fn test_recvmsg_rxq_ovfl() { in_socket, &mut iov, Some(&mut cmsgspace), - MsgFlags::MSG_DONTWAIT, - ) { + MsgFlags::MSG_DONTWAIT) { Ok(r) => { drop_counter = match r.cmsgs().next() { - Some(ControlMessageOwned::RxqOvfl(drop_counter)) => { - drop_counter - } + Some(ControlMessageOwned::RxqOvfl(drop_counter)) => drop_counter, Some(_) => panic!("Unexpected control message"), None => 0, }; - } - Err(Error::EAGAIN) => { - break; - } - _ => { - panic!("unknown recvmsg() error"); - } + }, + Err(Error::EAGAIN) => { break; }, + _ => { panic!("unknown recvmsg() error"); }, } } } @@ -2325,10 +1806,13 @@ fn test_recvmsg_rxq_ovfl() { nix::unistd::close(out_socket).unwrap(); } -#[cfg(any(target_os = "linux", target_os = "android",))] +#[cfg(any( + target_os = "linux", + target_os = "android", +))] mod linux_errqueue { - use super::FromStr; use nix::sys::socket::*; + use super::FromStr; // Send a UDP datagram to a bogus destination address and observe an ICMP error (v4). // @@ -2356,16 +1840,11 @@ mod linux_errqueue { // Closure handles protocol-specific testing and returns generic sock_extended_err for // protocol-independent test impl. |cmsg| { - if let ControlMessageOwned::Ipv4RecvErr(ext_err, err_addr) = - cmsg - { + if let ControlMessageOwned::Ipv4RecvErr(ext_err, err_addr) = cmsg { if let Some(origin) = err_addr { // Validate that our network error originated from 127.0.0.1:0. assert_eq!(origin.sin_family, AddressFamily::Inet as _); - assert_eq!( - origin.sin_addr.s_addr, - u32::from_be(0x7f000001) - ); + assert_eq!(origin.sin_addr.s_addr, u32::from_be(0x7f000001)); assert_eq!(origin.sin_port, 0); } else { panic!("Expected some error origin"); @@ -2404,15 +1883,10 @@ mod linux_errqueue { // Closure handles protocol-specific testing and returns generic sock_extended_err for // protocol-independent test impl. |cmsg| { - if let ControlMessageOwned::Ipv6RecvErr(ext_err, err_addr) = - cmsg - { + if let ControlMessageOwned::Ipv6RecvErr(ext_err, err_addr) = cmsg { if let Some(origin) = err_addr { // Validate that our network error originated from localhost:0. - assert_eq!( - origin.sin6_family, - AddressFamily::Inet6 as _ - ); + assert_eq!(origin.sin6_family, AddressFamily::Inet6 as _); assert_eq!( origin.sin6_addr.s6_addr, std::net::Ipv6Addr::LOCALHOST.octets() @@ -2429,17 +1903,16 @@ mod linux_errqueue { ) } - fn test_recverr_impl( - sa: &str, - af: AddressFamily, - opt: OPT, - ee_origin: u8, - ee_type: u8, - ee_code: u8, - testf: TESTF, - ) where - OPT: SetSockOpt, - TESTF: FnOnce(&ControlMessageOwned) -> libc::sock_extended_err, + fn test_recverr_impl(sa: &str, + af: AddressFamily, + opt: OPT, + ee_origin: u8, + ee_type: u8, + ee_code: u8, + testf: TESTF) + where + OPT: SetSockOpt, + TESTF: FnOnce(&ControlMessageOwned) -> libc::sock_extended_err, { use nix::errno::Errno; use std::io::IoSliceMut; @@ -2447,15 +1920,9 @@ mod linux_errqueue { const MESSAGE_CONTENTS: &str = "ABCDEF"; let std_sa = std::net::SocketAddr::from_str(sa).unwrap(); let sock_addr = SockaddrStorage::from(std_sa); - let sock = socket(af, SockType::Datagram, SockFlag::SOCK_CLOEXEC, None) - .unwrap(); + let sock = socket(af, SockType::Datagram, SockFlag::SOCK_CLOEXEC, None).unwrap(); setsockopt(sock, opt, &true).unwrap(); - if let Err(e) = sendto( - sock, - MESSAGE_CONTENTS.as_bytes(), - &sock_addr, - MsgFlags::empty(), - ) { + if let Err(e) = sendto(sock, MESSAGE_CONTENTS.as_bytes(), &sock_addr, MsgFlags::empty()) { assert_eq!(e, Errno::EADDRNOTAVAIL); println!("{:?} not available, skipping test.", af); return; @@ -2465,13 +1932,7 @@ mod linux_errqueue { let mut iovec = [IoSliceMut::new(&mut buf)]; let mut cspace = cmsg_space!(libc::sock_extended_err, SA); - let msg = recvmsg( - sock, - &mut iovec, - Some(&mut cspace), - MsgFlags::MSG_ERRQUEUE, - ) - .unwrap(); + let msg = recvmsg(sock, &mut iovec, Some(&mut cspace), MsgFlags::MSG_ERRQUEUE).unwrap(); // The sent message / destination associated with the error is returned: assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len()); // recvmsg(2): "The original destination address of the datagram that caused the error is @@ -2508,10 +1969,10 @@ mod linux_errqueue { pub fn test_txtime() { use nix::sys::socket::{ bind, recvmsg, sendmsg, setsockopt, socket, sockopt, ControlMessage, - MsgFlags, SockFlag, SockType, SockaddrIn, + MsgFlags, SockaddrIn, SockFlag, SockType, }; use nix::sys::time::TimeValLike; - use nix::time::{clock_gettime, ClockId}; + use nix::time::{ClockId, clock_gettime}; require_kernel_version!(test_txtime, ">= 5.8"); @@ -2548,8 +2009,7 @@ pub fn test_txtime() { let txtime = (now + delay).num_nanoseconds() as u64; let cmsg = ControlMessage::TxTime(&txtime); - sendmsg(ssock, &iov1, &[cmsg], MsgFlags::empty(), Some(&sock_addr)) - .unwrap(); + sendmsg(ssock, &iov1, &[cmsg], MsgFlags::empty(), Some(&sock_addr)).unwrap(); let mut rbuf = [0u8; 2048]; let mut iov2 = [std::io::IoSliceMut::new(&mut rbuf)]; diff --git a/bash-5.1/vendor/nix/test/sys/test_sockopt.rs b/bash-5.1/vendor/nix/test/sys/test_sockopt.rs index 2ddbf77b83ff766aad92c8f5b5f7b1409761772d..4f75e1784683bd9edeb14680314800b0c82cb733 100644 --- a/bash-5.1/vendor/nix/test/sys/test_sockopt.rs +++ b/bash-5.1/vendor/nix/test/sys/test_sockopt.rs @@ -1,27 +1,22 @@ +use rand::{thread_rng, Rng}; +use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol}; #[cfg(any(target_os = "android", target_os = "linux"))] use crate::*; -use nix::sys::socket::{ - getsockopt, setsockopt, socket, sockopt, AddressFamily, SockFlag, - SockProtocol, SockType, -}; -use rand::{thread_rng, Rng}; // NB: FreeBSD supports LOCAL_PEERCRED for SOCK_SEQPACKET, but OSX does not. -#[cfg(any(target_os = "dragonfly", target_os = "freebsd",))] +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", +))] #[test] pub fn test_local_peercred_seqpacket() { use nix::{ - sys::socket::socketpair, unistd::{Gid, Uid}, + sys::socket::socketpair }; - let (fd1, _fd2) = socketpair( - AddressFamily::Unix, - SockType::SeqPacket, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::SeqPacket, None, + SockFlag::empty()).unwrap(); let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); assert_eq!(xucred.version(), 0); assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); @@ -29,25 +24,20 @@ pub fn test_local_peercred_seqpacket() { } #[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "macos", - target_os = "ios" + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" ))] #[test] pub fn test_local_peercred_stream() { use nix::{ - sys::socket::socketpair, unistd::{Gid, Uid}, + sys::socket::socketpair }; - let (fd1, _fd2) = socketpair( - AddressFamily::Unix, - SockType::Stream, - None, - SockFlag::empty(), - ) - .unwrap(); + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, + SockFlag::empty()).unwrap(); let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); assert_eq!(xucred.version(), 0); assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); @@ -61,13 +51,7 @@ fn is_so_mark_functional() { require_capability!("is_so_mark_functional", CAP_NET_ADMIN); - let s = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - None, - ) - .unwrap(); + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); setsockopt(s, sockopt::Mark, &1337).unwrap(); let mark = getsockopt(s, sockopt::Mark).unwrap(); assert_eq!(mark, 1337); @@ -75,13 +59,8 @@ fn is_so_mark_functional() { #[test] fn test_so_buf() { - let fd = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - SockProtocol::Udp, - ) - .unwrap(); + let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), SockProtocol::Udp) + .unwrap(); let bufsize: usize = thread_rng().gen_range(4096..131_072); setsockopt(fd, sockopt::SndBuf, &bufsize).unwrap(); let actual = getsockopt(fd, sockopt::SndBuf).unwrap(); @@ -93,21 +72,16 @@ fn test_so_buf() { #[test] fn test_so_tcp_maxseg() { - use nix::sys::socket::{accept, bind, connect, listen, SockaddrIn}; - use nix::unistd::{close, write}; use std::net::SocketAddrV4; use std::str::FromStr; + use nix::sys::socket::{accept, bind, connect, listen, SockaddrIn}; + use nix::unistd::{close, write}; let std_sa = SocketAddrV4::from_str("127.0.0.1:4001").unwrap(); let sock_addr = SockaddrIn::from(std_sa); - let rsock = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - SockProtocol::Tcp, - ) - .unwrap(); + let rsock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); bind(rsock, &sock_addr).unwrap(); listen(rsock, 10).unwrap(); let initial = getsockopt(rsock, sockopt::TcpMaxSeg).unwrap(); @@ -125,13 +99,8 @@ fn test_so_tcp_maxseg() { } // Connect and check the MSS that was advertised - let ssock = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - SockProtocol::Tcp, - ) - .unwrap(); + let ssock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); connect(ssock, &sock_addr).unwrap(); let rsess = accept(rsock).unwrap(); write(rsess, b"hello").unwrap(); @@ -163,25 +132,17 @@ fn test_so_tcp_maxseg() { fn test_tcp_congestion() { use std::ffi::OsString; - let fd = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - None, - ) - .unwrap(); + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); let val = getsockopt(fd, sockopt::TcpCongestion).unwrap(); setsockopt(fd, sockopt::TcpCongestion, &val).unwrap(); - setsockopt( - fd, - sockopt::TcpCongestion, - &OsString::from("tcp_congestion_does_not_exist"), - ) - .unwrap_err(); + setsockopt(fd, sockopt::TcpCongestion, &OsString::from("tcp_congestion_does_not_exist")).unwrap_err(); - assert_eq!(getsockopt(fd, sockopt::TcpCongestion).unwrap(), val); + assert_eq!( + getsockopt(fd, sockopt::TcpCongestion).unwrap(), + val + ); } #[test] @@ -189,39 +150,28 @@ fn test_tcp_congestion() { fn test_bindtodevice() { skip_if_not_root!("test_bindtodevice"); - let fd = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - None, - ) - .unwrap(); + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); let val = getsockopt(fd, sockopt::BindToDevice).unwrap(); setsockopt(fd, sockopt::BindToDevice, &val).unwrap(); - assert_eq!(getsockopt(fd, sockopt::BindToDevice).unwrap(), val); + assert_eq!( + getsockopt(fd, sockopt::BindToDevice).unwrap(), + val + ); } #[test] fn test_so_tcp_keepalive() { - let fd = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - SockProtocol::Tcp, - ) - .unwrap(); + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); setsockopt(fd, sockopt::KeepAlive, &true).unwrap(); assert!(getsockopt(fd, sockopt::KeepAlive).unwrap()); - #[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux" - ))] - { + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] { let x = getsockopt(fd, sockopt::TcpKeepIdle).unwrap(); setsockopt(fd, sockopt::TcpKeepIdle, &(x + 1)).unwrap(); assert_eq!(getsockopt(fd, sockopt::TcpKeepIdle).unwrap(), x + 1); @@ -239,22 +189,10 @@ fn test_so_tcp_keepalive() { #[test] #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] fn test_ttl_opts() { - let fd4 = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); + let fd4 = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); setsockopt(fd4, sockopt::Ipv4Ttl, &1) .expect("setting ipv4ttl on an inet socket should succeed"); - let fd6 = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); + let fd6 = socket(AddressFamily::Inet6, SockType::Datagram, SockFlag::empty(), None).unwrap(); setsockopt(fd6, sockopt::Ipv6Ttl, &1) .expect("setting ipv6ttl on an inet6 socket should succeed"); } @@ -262,68 +200,38 @@ fn test_ttl_opts() { #[test] #[cfg(any(target_os = "ios", target_os = "macos"))] fn test_dontfrag_opts() { - let fd4 = socket( - AddressFamily::Inet, - SockType::Stream, - SockFlag::empty(), - SockProtocol::Tcp, - ) - .unwrap(); + let fd4 = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); setsockopt(fd4, sockopt::IpDontFrag, &true) .expect("setting IP_DONTFRAG on an inet stream socket should succeed"); - setsockopt(fd4, sockopt::IpDontFrag, &false).expect( - "unsetting IP_DONTFRAG on an inet stream socket should succeed", - ); - let fd4d = socket( - AddressFamily::Inet, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); - setsockopt(fd4d, sockopt::IpDontFrag, &true).expect( - "setting IP_DONTFRAG on an inet datagram socket should succeed", - ); - setsockopt(fd4d, sockopt::IpDontFrag, &false).expect( - "unsetting IP_DONTFRAG on an inet datagram socket should succeed", - ); + setsockopt(fd4, sockopt::IpDontFrag, &false) + .expect("unsetting IP_DONTFRAG on an inet stream socket should succeed"); + let fd4d = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd4d, sockopt::IpDontFrag, &true) + .expect("setting IP_DONTFRAG on an inet datagram socket should succeed"); + setsockopt(fd4d, sockopt::IpDontFrag, &false) + .expect("unsetting IP_DONTFRAG on an inet datagram socket should succeed"); } #[test] #[cfg(any( - target_os = "android", - target_os = "ios", - target_os = "linux", - target_os = "macos", -))] + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + ) +)] // Disable the test under emulation because it fails in Cirrus-CI. Lack // of QEMU support is suspected. #[cfg_attr(qemu, ignore)] fn test_v6dontfrag_opts() { - let fd6 = socket( - AddressFamily::Inet6, - SockType::Stream, - SockFlag::empty(), - SockProtocol::Tcp, - ) - .unwrap(); - setsockopt(fd6, sockopt::Ipv6DontFrag, &true).expect( - "setting IPV6_DONTFRAG on an inet6 stream socket should succeed", - ); - setsockopt(fd6, sockopt::Ipv6DontFrag, &false).expect( - "unsetting IPV6_DONTFRAG on an inet6 stream socket should succeed", - ); - let fd6d = socket( - AddressFamily::Inet6, - SockType::Datagram, - SockFlag::empty(), - None, - ) - .unwrap(); - setsockopt(fd6d, sockopt::Ipv6DontFrag, &true).expect( - "setting IPV6_DONTFRAG on an inet6 datagram socket should succeed", - ); - setsockopt(fd6d, sockopt::Ipv6DontFrag, &false).expect( - "unsetting IPV6_DONTFRAG on an inet6 datagram socket should succeed", - ); + let fd6 = socket(AddressFamily::Inet6, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); + setsockopt(fd6, sockopt::Ipv6DontFrag, &true) + .expect("setting IPV6_DONTFRAG on an inet6 stream socket should succeed"); + setsockopt(fd6, sockopt::Ipv6DontFrag, &false) + .expect("unsetting IPV6_DONTFRAG on an inet6 stream socket should succeed"); + let fd6d = socket(AddressFamily::Inet6, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &true) + .expect("setting IPV6_DONTFRAG on an inet6 datagram socket should succeed"); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &false) + .expect("unsetting IPV6_DONTFRAG on an inet6 datagram socket should succeed"); } diff --git a/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs b/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs index 2897366effc905dde51ca2fc686d55f73233f026..73e6586f6223e637dd94b0b6ded6008dd4ce48f2 100644 --- a/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs +++ b/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs @@ -9,12 +9,10 @@ fn sysinfo_works() { assert!(l5 >= 0.0); assert!(l15 >= 0.0); - info.uptime(); // just test Duration construction + info.uptime(); // just test Duration construction - assert!( - info.swap_free() <= info.swap_total(), - "more swap available than installed (free: {}, total: {})", - info.swap_free(), - info.swap_total() - ); + assert!(info.swap_free() <= info.swap_total(), + "more swap available than installed (free: {}, total: {})", + info.swap_free(), + info.swap_total()); } diff --git a/bash-5.1/vendor/nix/test/sys/test_termios.rs b/bash-5.1/vendor/nix/test/sys/test_termios.rs index aaf00084fa050bbf346c7ab53ff959dd1164f0af..4a8615437e22d7db175cf6b10373cbcea516a568 100644 --- a/bash-5.1/vendor/nix/test/sys/test_termios.rs +++ b/bash-5.1/vendor/nix/test/sys/test_termios.rs @@ -1,11 +1,11 @@ use std::os::unix::prelude::*; use tempfile::tempfile; -use nix::errno::Errno; use nix::fcntl; +use nix::errno::Errno; use nix::pty::openpty; -use nix::sys::termios::{self, tcgetattr, LocalFlags, OutputFlags}; -use nix::unistd::{close, read, write}; +use nix::sys::termios::{self, LocalFlags, OutputFlags, tcgetattr}; +use nix::unistd::{read, write, close}; /// Helper function analogous to `std::io::Write::write_all`, but for `RawFd`s fn write_all(f: RawFd, buf: &[u8]) { @@ -22,7 +22,7 @@ fn test_tcgetattr_pty() { let _m = crate::PTSNAME_MTX.lock(); let pty = openpty(None, None).expect("openpty failed"); - termios::tcgetattr(pty.slave).unwrap(); + assert!(termios::tcgetattr(pty.slave).is_ok()); close(pty.master).expect("closing the master failed"); close(pty.slave).expect("closing the slave failed"); } @@ -31,16 +31,15 @@ fn test_tcgetattr_pty() { #[test] fn test_tcgetattr_enotty() { let file = tempfile().unwrap(); - assert_eq!( - termios::tcgetattr(file.as_raw_fd()).err(), - Some(Errno::ENOTTY) - ); + assert_eq!(termios::tcgetattr(file.as_raw_fd()).err(), + Some(Errno::ENOTTY)); } // Test tcgetattr on an invalid file descriptor #[test] fn test_tcgetattr_ebadf() { - assert_eq!(termios::tcgetattr(-1).err(), Some(Errno::EBADF)); + assert_eq!(termios::tcgetattr(-1).err(), + Some(Errno::EBADF)); } // Test modifying output flags @@ -61,15 +60,11 @@ fn test_output_flags() { }; // Make sure postprocessing '\r' isn't specified by default or this test is useless. - assert!(!termios - .output_flags - .contains(OutputFlags::OPOST | OutputFlags::OCRNL)); + assert!(!termios.output_flags.contains(OutputFlags::OPOST | OutputFlags::OCRNL)); // Specify that '\r' characters should be transformed to '\n' // OPOST is specified to enable post-processing - termios - .output_flags - .insert(OutputFlags::OPOST | OutputFlags::OCRNL); + termios.output_flags.insert(OutputFlags::OPOST | OutputFlags::OCRNL); // Open a pty let pty = openpty(None, &termios).unwrap(); @@ -119,8 +114,7 @@ fn test_local_flags() { // Set the master is in nonblocking mode or reading will never return. let flags = fcntl::fcntl(pty.master, fcntl::F_GETFL).unwrap(); - let new_flags = - fcntl::OFlag::from_bits_truncate(flags) | fcntl::OFlag::O_NONBLOCK; + let new_flags = fcntl::OFlag::from_bits_truncate(flags) | fcntl::OFlag::O_NONBLOCK; fcntl::fcntl(pty.master, fcntl::F_SETFL(new_flags)).unwrap(); // Write into the master diff --git a/bash-5.1/vendor/nix/test/sys/test_timerfd.rs b/bash-5.1/vendor/nix/test/sys/test_timerfd.rs index 927cc70d1d10b5bb040b24ef6a8256f6b5c387d2..24fb2ac002e1da959a377956d04aedf13c2df4ef 100644 --- a/bash-5.1/vendor/nix/test/sys/test_timerfd.rs +++ b/bash-5.1/vendor/nix/test/sys/test_timerfd.rs @@ -1,13 +1,10 @@ use nix::sys::time::{TimeSpec, TimeValLike}; -use nix::sys::timerfd::{ - ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags, -}; +use nix::sys::timerfd::{ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags}; use std::time::Instant; #[test] pub fn test_timerfd_oneshot() { - let timer = - TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); let before = Instant::now(); @@ -26,16 +23,12 @@ pub fn test_timerfd_oneshot() { #[test] pub fn test_timerfd_interval() { - let timer = - TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); let before = Instant::now(); timer .set( - Expiration::IntervalDelayed( - TimeSpec::seconds(1), - TimeSpec::seconds(2), - ), + Expiration::IntervalDelayed(TimeSpec::seconds(1), TimeSpec::seconds(2)), TimerSetTimeFlags::empty(), ) .unwrap(); @@ -53,8 +46,7 @@ pub fn test_timerfd_interval() { #[test] pub fn test_timerfd_unset() { - let timer = - TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); timer .set( diff --git a/bash-5.1/vendor/nix/test/sys/test_uio.rs b/bash-5.1/vendor/nix/test/sys/test_uio.rs index 0f4b8a65680cc01205b7a991d080e3796f37f061..7dd12a21b0d7c20af79e4f5784963ddc870b600a 100644 --- a/bash-5.1/vendor/nix/test/sys/test_uio.rs +++ b/bash-5.1/vendor/nix/test/sys/test_uio.rs @@ -1,18 +1,18 @@ use nix::sys::uio::*; use nix::unistd::*; -use rand::distributions::Alphanumeric; use rand::{thread_rng, Rng}; -use std::fs::OpenOptions; +use rand::distributions::Alphanumeric; +use std::{cmp, iter}; +use std::fs::{OpenOptions}; use std::io::IoSlice; use std::os::unix::io::AsRawFd; -use std::{cmp, iter}; #[cfg(not(target_os = "redox"))] use std::io::IoSliceMut; -use tempfile::tempdir; #[cfg(not(target_os = "redox"))] use tempfile::tempfile; +use tempfile::tempdir; #[test] fn test_writev() { @@ -31,38 +31,41 @@ fn test_writev() { let mut consumed = 0; while consumed < to_write.len() { let left = to_write.len() - consumed; - let slice_len = if left <= 64 { - left - } else { - thread_rng().gen_range(64..cmp::min(256, left)) - }; - let b = &to_write[consumed..consumed + slice_len]; + let slice_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; + let b = &to_write[consumed..consumed+slice_len]; iovecs.push(IoSlice::new(b)); consumed += slice_len; } let pipe_res = pipe(); - let (reader, writer) = pipe_res.expect("Couldn't create pipe"); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); // FileDesc will close its filedesc (reader). let mut read_buf: Vec = iter::repeat(0u8).take(128 * 16).collect(); // Blocking io, should write all data. let write_res = writev(writer, &iovecs); - let written = write_res.expect("couldn't write"); + // Successful write + assert!(write_res.is_ok()); + let written = write_res.ok().unwrap(); // Check whether we written all data assert_eq!(to_write.len(), written); let read_res = read(reader, &mut read_buf[..]); - let read = read_res.expect("couldn't read"); + // Successful read + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap() as usize; // Check we have read as much as we written assert_eq!(read, written); // Check equality of written and read data assert_eq!(&to_write, &read_buf); - close(writer).expect("closed writer"); - close(reader).expect("closed reader"); + let close_res = close(writer); + assert!(close_res.is_ok()); + let close_res = close(reader); + assert!(close_res.is_ok()); } #[test] #[cfg(not(target_os = "redox"))] fn test_readv() { - let s: String = thread_rng() + let s:String = thread_rng() .sample_iter(&Alphanumeric) .map(char::from) .take(128) @@ -72,11 +75,7 @@ fn test_readv() { let mut allocated = 0; while allocated < to_write.len() { let left = to_write.len() - allocated; - let vec_len = if left <= 64 { - left - } else { - thread_rng().gen_range(64..cmp::min(256, left)) - }; + let vec_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; let v: Vec = iter::repeat(0u8).take(vec_len).collect(); storage.push(v); allocated += vec_len; @@ -85,10 +84,16 @@ fn test_readv() { for v in &mut storage { iovecs.push(IoSliceMut::new(&mut v[..])); } - let (reader, writer) = pipe().expect("couldn't create pipe"); + let pipe_res = pipe(); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); // Blocking io, should write all data. - write(writer, &to_write).expect("write failed"); - let read = readv(reader, &mut iovecs[..]).expect("read failed"); + let write_res = write(writer, &to_write); + // Successful write + assert!(write_res.is_ok()); + let read_res = readv(reader, &mut iovecs[..]); + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap(); // Check whether we've read all data assert_eq!(to_write.len(), read); // Cccumulate data from iovecs @@ -100,8 +105,10 @@ fn test_readv() { assert_eq!(read_buf.len(), to_write.len()); // Check equality of written and read data assert_eq!(&read_buf, &to_write); - close(reader).expect("couldn't close reader"); - close(writer).expect("couldn't close writer"); + let close_res = close(reader); + assert!(close_res.is_ok()); + let close_res = close(writer); + assert!(close_res.is_ok()); } #[test] @@ -110,12 +117,12 @@ fn test_pwrite() { use std::io::Read; let mut file = tempfile().unwrap(); - let buf = [1u8; 8]; + let buf = [1u8;8]; assert_eq!(Ok(8), pwrite(file.as_raw_fd(), &buf, 8)); let mut file_content = Vec::new(); file.read_to_end(&mut file_content).unwrap(); - let mut expected = vec![0u8; 8]; - expected.extend(vec![1; 8]); + let mut expected = vec![0u8;8]; + expected.extend(vec![1;8]); assert_eq!(file_content, expected); } @@ -126,29 +133,24 @@ fn test_pread() { let tempdir = tempdir().unwrap(); let path = tempdir.path().join("pread_test_file"); - let mut file = OpenOptions::new() - .write(true) - .read(true) - .create(true) - .truncate(true) - .open(path) - .unwrap(); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); let file_content: Vec = (0..64).collect(); file.write_all(&file_content).unwrap(); - let mut buf = [0u8; 16]; + let mut buf = [0u8;16]; assert_eq!(Ok(16), pread(file.as_raw_fd(), &mut buf, 16)); let expected: Vec<_> = (16..32).collect(); assert_eq!(&buf[..], &expected[..]); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_pwritev() { use std::io::Read; let to_write: Vec = (0..128).collect(); - let expected: Vec = [vec![0; 100], to_write.clone()].concat(); + let expected: Vec = [vec![0;100], to_write.clone()].concat(); let iovecs = [ IoSlice::new(&to_write[0..17]), @@ -160,13 +162,8 @@ fn test_pwritev() { // pwritev them into a temporary file let path = tempdir.path().join("pwritev_test_file"); - let mut file = OpenOptions::new() - .write(true) - .read(true) - .create(true) - .truncate(true) - .open(path) - .unwrap(); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); let written = pwritev(file.as_raw_fd(), &iovecs, 100).ok().unwrap(); assert_eq!(written, to_write.len()); @@ -178,7 +175,7 @@ fn test_pwritev() { } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_preadv() { use std::io::Write; @@ -189,23 +186,20 @@ fn test_preadv() { let path = tempdir.path().join("preadv_test_file"); - let mut file = OpenOptions::new() - .read(true) - .write(true) - .create(true) - .truncate(true) - .open(path) - .unwrap(); + let mut file = OpenOptions::new().read(true).write(true).create(true) + .truncate(true).open(path).unwrap(); file.write_all(&to_write).unwrap(); - let mut buffers: Vec> = vec![vec![0; 24], vec![0; 1], vec![0; 75]]; + let mut buffers: Vec> = vec![ + vec![0; 24], + vec![0; 1], + vec![0; 75], + ]; { // Borrow the buffers into IoVecs and preadv into them - let mut iovecs: Vec<_> = buffers - .iter_mut() - .map(|buf| IoSliceMut::new(&mut buf[..])) - .collect(); + let mut iovecs: Vec<_> = buffers.iter_mut().map( + |buf| IoSliceMut::new(&mut buf[..])).collect(); assert_eq!(Ok(100), preadv(file.as_raw_fd(), &mut iovecs, 100)); } @@ -214,15 +208,14 @@ fn test_preadv() { } #[test] -#[cfg(all(target_os = "linux", not(target_env = "uclibc")))] -// uclibc doesn't implement process_vm_readv +#[cfg(all(target_os = "linux", not(target_env = "uclibc")))] // uclibc doesn't implement process_vm_readv // qemu-user doesn't implement process_vm_readv/writev on most arches #[cfg_attr(qemu, ignore)] fn test_process_vm_readv() { - use crate::*; + use nix::unistd::ForkResult::*; use nix::sys::signal::*; use nix::sys::wait::*; - use nix::unistd::ForkResult::*; + use crate::*; require_capability!("test_process_vm_readv", CAP_SYS_PTRACE); let _m = crate::FORK_MTX.lock(); @@ -232,7 +225,7 @@ fn test_process_vm_readv() { let mut vector = vec![1u8, 2, 3, 4, 5]; let (r, w) = pipe().unwrap(); - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Parent { child } => { close(w).unwrap(); // wait for child @@ -243,18 +236,16 @@ fn test_process_vm_readv() { let remote_iov = RemoteIoVec { base: ptr, len: 5 }; let mut buf = vec![0u8; 5]; - let ret = process_vm_readv( - child, - &mut [IoSliceMut::new(&mut buf)], - &[remote_iov], - ); + let ret = process_vm_readv(child, + &mut [IoSliceMut::new(&mut buf)], + &[remote_iov]); kill(child, SIGTERM).unwrap(); waitpid(child, None).unwrap(); assert_eq!(Ok(5), ret); assert_eq!(20u8, buf.iter().sum()); - } + }, Child => { let _ = close(r); for i in &mut vector { @@ -262,9 +253,7 @@ fn test_process_vm_readv() { } let _ = write(w, b"\0"); let _ = close(w); - loop { - pause(); - } - } + loop { let _ = pause(); } + }, } } diff --git a/bash-5.1/vendor/nix/test/sys/test_wait.rs b/bash-5.1/vendor/nix/test/sys/test_wait.rs index d472f1ec19b8817ce93ef1c483e72d34fbf1a637..90d9fcf51c673b0f279c92faabd85878309bb807 100644 --- a/bash-5.1/vendor/nix/test/sys/test_wait.rs +++ b/bash-5.1/vendor/nix/test/sys/test_wait.rs @@ -1,28 +1,25 @@ -use libc::_exit; use nix::errno::Errno; +use nix::unistd::*; +use nix::unistd::ForkResult::*; use nix::sys::signal::*; use nix::sys::wait::*; -use nix::unistd::ForkResult::*; -use nix::unistd::*; +use libc::_exit; #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_wait_signal() { let _m = crate::FORK_MTX.lock(); // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. - match unsafe { fork() }.expect("Error: Fork Failed") { - Child => { - pause(); - unsafe { _exit(123) } - } - Parent { child } => { - kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Signaled(child, SIGKILL, false)) - ); - } + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + }, + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false))); + }, } } @@ -30,7 +27,7 @@ fn test_wait_signal() { #[cfg(any( target_os = "android", target_os = "freebsd", - //target_os = "haiku", + target_os = "haiku", all(target_os = "linux", not(target_env = "uclibc")), ))] #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] @@ -38,18 +35,18 @@ fn test_waitid_signal() { let _m = crate::FORK_MTX.lock(); // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. - match unsafe { fork() }.expect("Error: Fork Failed") { - Child => { - pause(); - unsafe { _exit(123) } - } - Parent { child } => { - kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); - assert_eq!( - waitid(Id::Pid(child), WaitPidFlag::WEXITED), - Ok(WaitStatus::Signaled(child, SIGKILL, false)), - ); - } + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + }, + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Signaled(child, SIGKILL, false)), + ); + }, } } @@ -58,17 +55,14 @@ fn test_wait_exit() { let _m = crate::FORK_MTX.lock(); // Safe: Child only calls `_exit`, which is async-signal-safe. - match unsafe { fork() }.expect("Error: Fork Failed") { - Child => unsafe { - _exit(12); - }, - Parent { child } => { - assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 12))); - } + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(12); }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 12))); + }, } } -#[cfg(not(target_os = "haiku"))] #[test] #[cfg(any( target_os = "android", @@ -81,30 +75,22 @@ fn test_waitid_exit() { let _m = crate::FORK_MTX.lock(); // Safe: Child only calls `_exit`, which is async-signal-safe. - match unsafe { fork() }.expect("Error: Fork Failed") { - Child => unsafe { - _exit(12); - }, - Parent { child } => { - assert_eq!( - waitid(Id::Pid(child), WaitPidFlag::WEXITED), - Ok(WaitStatus::Exited(child, 12)), - ); - } + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(12); }, + Parent { child } => { + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Exited(child, 12)), + ); + } } } #[test] fn test_waitstatus_from_raw() { let pid = Pid::from_raw(1); - assert_eq!( - WaitStatus::from_raw(pid, 0x0002), - Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false)) - ); - assert_eq!( - WaitStatus::from_raw(pid, 0x0200), - Ok(WaitStatus::Exited(pid, 2)) - ); + assert_eq!(WaitStatus::from_raw(pid, 0x0002), Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + assert_eq!(WaitStatus::from_raw(pid, 0x0200), Ok(WaitStatus::Exited(pid, 2))); assert_eq!(WaitStatus::from_raw(pid, 0x7f7f), Err(Errno::EINVAL)); } @@ -112,7 +98,7 @@ fn test_waitstatus_from_raw() { fn test_waitstatus_pid() { let _m = crate::FORK_MTX.lock(); - match unsafe { fork() }.unwrap() { + match unsafe{fork()}.unwrap() { Child => unsafe { _exit(0) }, Parent { child } => { let status = waitpid(child, None).unwrap(); @@ -144,13 +130,13 @@ fn test_waitid_pid() { // FIXME: qemu-user doesn't implement ptrace on most arches #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] mod ptrace { - use crate::*; - use libc::_exit; - use nix::sys::ptrace::{self, Event, Options}; + use nix::sys::ptrace::{self, Options, Event}; use nix::sys::signal::*; use nix::sys::wait::*; - use nix::unistd::ForkResult::*; use nix::unistd::*; + use nix::unistd::ForkResult::*; + use libc::_exit; + use crate::*; fn ptrace_child() -> ! { ptrace::traceme().unwrap(); @@ -162,32 +148,18 @@ mod ptrace { fn ptrace_wait_parent(child: Pid) { // Wait for the raised SIGTRAP - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::Stopped(child, SIGTRAP)) - ); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, SIGTRAP))); // We want to test a syscall stop and a PTRACE_EVENT stop - ptrace::setoptions( - child, - Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT, - ) - .expect("setoptions failed"); + assert!(ptrace::setoptions(child, Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT).is_ok()); // First, stop on the next system call, which will be exit() - ptrace::syscall(child, None).expect("syscall failed"); + assert!(ptrace::syscall(child, None).is_ok()); assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); // Then get the ptrace event for the process exiting - ptrace::cont(child, None).expect("cont failed"); - assert_eq!( - waitpid(child, None), - Ok(WaitStatus::PtraceEvent( - child, - SIGTRAP, - Event::PTRACE_EVENT_EXIT as i32 - )) - ); + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, SIGTRAP, Event::PTRACE_EVENT_EXIT as i32))); // Finally get the normal wait() result, now that the process has exited - ptrace::cont(child, None).expect("cont failed"); + assert!(ptrace::cont(child, None).is_ok()); assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 0))); } @@ -202,30 +174,22 @@ mod ptrace { Ok(WaitStatus::PtraceEvent(child, SIGTRAP, 0)), ); // We want to test a syscall stop and a PTRACE_EVENT stop - ptrace::setoptions( - child, - Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT, - ) - .expect("setopts failed"); + assert!(ptrace::setoptions(child, Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT).is_ok()); // First, stop on the next system call, which will be exit() - ptrace::syscall(child, None).expect("syscall failed"); + assert!(ptrace::syscall(child, None).is_ok()); assert_eq!( waitid(Id::Pid(child), WaitPidFlag::WEXITED), Ok(WaitStatus::PtraceSyscall(child)), ); // Then get the ptrace event for the process exiting - ptrace::cont(child, None).expect("cont failed"); + assert!(ptrace::cont(child, None).is_ok()); assert_eq!( waitid(Id::Pid(child), WaitPidFlag::WEXITED), - Ok(WaitStatus::PtraceEvent( - child, - SIGTRAP, - Event::PTRACE_EVENT_EXIT as i32 - )), + Ok(WaitStatus::PtraceEvent(child, SIGTRAP, Event::PTRACE_EVENT_EXIT as i32)), ); // Finally get the normal wait() result, now that the process has exited - ptrace::cont(child, None).expect("cont failed"); + assert!(ptrace::cont(child, None).is_ok()); assert_eq!( waitid(Id::Pid(child), WaitPidFlag::WEXITED), Ok(WaitStatus::Exited(child, 0)), @@ -237,7 +201,7 @@ mod ptrace { require_capability!("test_wait_ptrace", CAP_SYS_PTRACE); let _m = crate::FORK_MTX.lock(); - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => ptrace_child(), Parent { child } => ptrace_wait_parent(child), } @@ -249,7 +213,7 @@ mod ptrace { require_capability!("test_waitid_ptrace", CAP_SYS_PTRACE); let _m = crate::FORK_MTX.lock(); - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => ptrace_child(), Parent { child } => ptrace_waitid_parent(child), } diff --git a/bash-5.1/vendor/nix/test/test.rs b/bash-5.1/vendor/nix/test/test.rs index f725ef97a0807ca4fc7ccdf2db4654c20ab9f683..3cac48f77f5086625acdbeb988b741372701ce66 100644 --- a/bash-5.1/vendor/nix/test/test.rs +++ b/bash-5.1/vendor/nix/test/test.rs @@ -1,6 +1,6 @@ #[macro_use] extern crate cfg_if; -#[cfg_attr(not(any(target_os = "redox", target_os = "haiku")), macro_use)] +#[cfg_attr(not(target_os = "redox"), macro_use)] extern crate nix; #[macro_use] extern crate lazy_static; @@ -10,46 +10,38 @@ mod sys; #[cfg(not(target_os = "redox"))] mod test_dir; mod test_fcntl; -#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(any(target_os = "android", + target_os = "linux"))] mod test_kmod; -#[cfg(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fushsia", - target_os = "linux", - target_os = "netbsd" -))] +#[cfg(target_os = "freebsd")] +mod test_nmount; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] mod test_mq; #[cfg(not(target_os = "redox"))] mod test_net; mod test_nix_path; -#[cfg(target_os = "freebsd")] -mod test_nmount; +mod test_resource; mod test_poll; -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] mod test_pty; -mod test_resource; -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "linux" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "linux"))] mod test_sched; -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "linux", - target_os = "macos" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] mod test_sendfile; mod test_stat; mod test_time; +mod test_unistd; #[cfg(all( any( target_os = "freebsd", @@ -61,15 +53,15 @@ mod test_time; feature = "signal" ))] mod test_timer; -mod test_unistd; -use nix::unistd::{chdir, getcwd, read}; -use parking_lot::{Mutex, RwLock, RwLockWriteGuard}; use std::os::unix::io::RawFd; use std::path::PathBuf; +use parking_lot::{Mutex, RwLock, RwLockWriteGuard}; +use nix::unistd::{chdir, getcwd, read}; + /// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s -fn read_exact(f: RawFd, buf: &mut [u8]) { +fn read_exact(f: RawFd, buf: &mut [u8]) { let mut len = 0; while len < buf.len() { // get_mut would be better than split_at_mut, but it requires nightly @@ -100,13 +92,13 @@ lazy_static! { /// RAII object that restores a test's original directory on drop struct DirRestore<'a> { d: PathBuf, - _g: RwLockWriteGuard<'a, ()>, + _g: RwLockWriteGuard<'a, ()> } impl<'a> DirRestore<'a> { fn new() -> Self { let guard = crate::CWD_LOCK.write(); - DirRestore { + DirRestore{ _g: guard, d: getcwd().unwrap(), } diff --git a/bash-5.1/vendor/nix/test/test_dir.rs b/bash-5.1/vendor/nix/test/test_dir.rs index f66299210e0eb83b10fbbe158cc12cd1dd5baa38..2940b6eafb351b27da004a431972b41d9031966c 100644 --- a/bash-5.1/vendor/nix/test/test_dir.rs +++ b/bash-5.1/vendor/nix/test/test_dir.rs @@ -4,6 +4,7 @@ use nix::sys::stat::Mode; use std::fs::File; use tempfile::tempdir; + #[cfg(test)] fn flags() -> OFlag { #[cfg(target_os = "illumos")] @@ -16,11 +17,11 @@ fn flags() -> OFlag { } #[test] -#[allow(clippy::unnecessary_sort_by)] // False positive +#[allow(clippy::unnecessary_sort_by)] // False positive fn read() { let tmp = tempdir().unwrap(); File::create(&tmp.path().join("foo")).unwrap(); - std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap(); + ::std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap(); let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); let mut entries: Vec<_> = dir.iter().map(|e| e.unwrap()).collect(); entries.sort_by(|a, b| a.file_name().cmp(b.file_name())); @@ -42,23 +43,13 @@ fn read() { fn rewind() { let tmp = tempdir().unwrap(); let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); - let entries1: Vec<_> = dir - .iter() - .map(|e| e.unwrap().file_name().to_owned()) - .collect(); - let entries2: Vec<_> = dir - .iter() - .map(|e| e.unwrap().file_name().to_owned()) - .collect(); - let entries3: Vec<_> = dir - .into_iter() - .map(|e| e.unwrap().file_name().to_owned()) - .collect(); + let entries1: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries2: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries3: Vec<_> = dir.into_iter().map(|e| e.unwrap().file_name().to_owned()).collect(); assert_eq!(entries1, entries2); assert_eq!(entries2, entries3); } -#[cfg(not(target_os = "haiku"))] #[test] fn ebadf() { assert_eq!(Dir::from_fd(-1).unwrap_err(), nix::Error::EBADF); diff --git a/bash-5.1/vendor/nix/test/test_fcntl.rs b/bash-5.1/vendor/nix/test/test_fcntl.rs index f4adee21fc431c39bb70cdc0b5be8f12a68df6ca..ebfc43e25fc254864ccbf7ba278129ede36d452b 100644 --- a/bash-5.1/vendor/nix/test/test_fcntl.rs +++ b/bash-5.1/vendor/nix/test/test_fcntl.rs @@ -1,7 +1,7 @@ #[cfg(not(target_os = "redox"))] use nix::errno::*; #[cfg(not(target_os = "redox"))] -use nix::fcntl::{open, readlink, OFlag}; +use nix::fcntl::{open, OFlag, readlink}; #[cfg(not(target_os = "redox"))] use nix::fcntl::{openat, readlinkat, renameat}; #[cfg(all( @@ -14,19 +14,19 @@ use nix::fcntl::{openat, readlinkat, renameat}; target_arch = "s390x" ) ))] -use nix::fcntl::{renameat2, RenameFlags}; +use nix::fcntl::{RenameFlags, renameat2}; #[cfg(not(target_os = "redox"))] use nix::sys::stat::Mode; #[cfg(not(target_os = "redox"))] use nix::unistd::{close, read}; #[cfg(not(target_os = "redox"))] +use tempfile::{self, NamedTempFile}; +#[cfg(not(target_os = "redox"))] use std::fs::File; #[cfg(not(target_os = "redox"))] use std::io::prelude::*; #[cfg(not(target_os = "redox"))] use std::os::unix::fs; -#[cfg(not(target_os = "redox"))] -use tempfile::{self, NamedTempFile}; #[test] #[cfg(not(target_os = "redox"))] @@ -38,16 +38,13 @@ fn test_openat() { let mut tmp = NamedTempFile::new().unwrap(); tmp.write_all(CONTENTS).unwrap(); - let dirfd = - open(tmp.path().parent().unwrap(), OFlag::empty(), Mode::empty()) - .unwrap(); - let fd = openat( - dirfd, - tmp.path().file_name().unwrap(), - OFlag::O_RDONLY, - Mode::empty(), - ) - .unwrap(); + let dirfd = open(tmp.path().parent().unwrap(), + OFlag::empty(), + Mode::empty()).unwrap(); + let fd = openat(dirfd, + tmp.path().file_name().unwrap(), + OFlag::O_RDONLY, + Mode::empty()).unwrap(); let mut buf = [0u8; 1024]; assert_eq!(4, read(fd, &mut buf).unwrap()); @@ -61,18 +58,14 @@ fn test_openat() { #[cfg(not(target_os = "redox"))] fn test_renameat() { let old_dir = tempfile::tempdir().unwrap(); - let old_dirfd = - open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let old_path = old_dir.path().join("old"); File::create(&old_path).unwrap(); let new_dir = tempfile::tempdir().unwrap(); - let new_dirfd = - open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap(); - assert_eq!( - renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), - Errno::ENOENT - ); + assert_eq!(renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), + Errno::ENOENT); close(old_dirfd).unwrap(); close(new_dirfd).unwrap(); assert!(new_dir.path().join("new").exists()); @@ -91,13 +84,11 @@ fn test_renameat() { ))] fn test_renameat2_behaves_like_renameat_with_no_flags() { let old_dir = tempfile::tempdir().unwrap(); - let old_dirfd = - open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let old_path = old_dir.path().join("old"); File::create(&old_path).unwrap(); let new_dir = tempfile::tempdir().unwrap(); - let new_dirfd = - open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); renameat2( Some(old_dirfd), "old", @@ -135,16 +126,14 @@ fn test_renameat2_behaves_like_renameat_with_no_flags() { ))] fn test_renameat2_exchange() { let old_dir = tempfile::tempdir().unwrap(); - let old_dirfd = - open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let old_path = old_dir.path().join("old"); { let mut old_f = File::create(&old_path).unwrap(); old_f.write_all(b"old").unwrap(); } let new_dir = tempfile::tempdir().unwrap(); - let new_dirfd = - open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let new_path = new_dir.path().join("new"); { let mut new_f = File::create(&new_path).unwrap(); @@ -183,13 +172,11 @@ fn test_renameat2_exchange() { ))] fn test_renameat2_noreplace() { let old_dir = tempfile::tempdir().unwrap(); - let old_dirfd = - open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let old_path = old_dir.path().join("old"); File::create(&old_path).unwrap(); let new_dir = tempfile::tempdir().unwrap(); - let new_dirfd = - open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); let new_path = new_dir.path().join("new"); File::create(&new_path).unwrap(); assert_eq!( @@ -209,6 +196,7 @@ fn test_renameat2_noreplace() { assert!(old_dir.path().join("old").exists()); } + #[test] #[cfg(not(target_os = "redox"))] fn test_readlink() { @@ -217,22 +205,22 @@ fn test_readlink() { let dst = tempdir.path().join("b"); println!("a: {:?}, b: {:?}", &src, &dst); fs::symlink(&src.as_path(), &dst.as_path()).unwrap(); - let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let dirfd = open(tempdir.path(), + OFlag::empty(), + Mode::empty()).unwrap(); let expected_dir = src.to_str().unwrap(); assert_eq!(readlink(&dst).unwrap().to_str().unwrap(), expected_dir); - assert_eq!( - readlinkat(dirfd, "b").unwrap().to_str().unwrap(), - expected_dir - ); + assert_eq!(readlinkat(dirfd, "b").unwrap().to_str().unwrap(), expected_dir); + } #[cfg(any(target_os = "linux", target_os = "android"))] mod linux_android { - use libc::loff_t; use std::io::prelude::*; use std::io::{IoSlice, SeekFrom}; use std::os::unix::prelude::*; + use libc::loff_t; use nix::fcntl::*; use nix::unistd::{close, pipe, read, write}; @@ -287,15 +275,8 @@ mod linux_android { let (rd, wr) = pipe().unwrap(); let mut offset: loff_t = 5; - let res = splice( - tmp.as_raw_fd(), - Some(&mut offset), - wr, - None, - 2, - SpliceFFlags::empty(), - ) - .unwrap(); + let res = splice(tmp.as_raw_fd(), Some(&mut offset), + wr, None, 2, SpliceFFlags::empty()).unwrap(); assert_eq!(2, res); @@ -340,7 +321,10 @@ mod linux_android { let buf1 = b"abcdef"; let buf2 = b"defghi"; - let iovecs = vec![IoSlice::new(&buf1[0..3]), IoSlice::new(&buf2[0..3])]; + let iovecs = vec![ + IoSlice::new(&buf1[0..3]), + IoSlice::new(&buf2[0..3]) + ]; let res = vmsplice(wr, &iovecs[..], SpliceFFlags::empty()).unwrap(); @@ -375,7 +359,7 @@ mod linux_android { #[test] #[cfg(all(target_os = "linux", not(target_env = "musl")))] - #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile fn test_ofd_write_lock() { use nix::sys::stat::fstat; use std::mem; @@ -393,7 +377,7 @@ mod linux_android { let inode = fstat(fd).expect("fstat failed").st_ino as usize; let mut flock: libc::flock = unsafe { - mem::zeroed() // required for Linux/mips + mem::zeroed() // required for Linux/mips }; flock.l_type = libc::F_WRLCK as libc::c_short; flock.l_whence = libc::SEEK_SET as libc::c_short; @@ -413,7 +397,7 @@ mod linux_android { #[test] #[cfg(all(target_os = "linux", not(target_env = "musl")))] - #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile fn test_ofd_read_lock() { use nix::sys::stat::fstat; use std::mem; @@ -431,7 +415,7 @@ mod linux_android { let inode = fstat(fd).expect("fstat failed").st_ino as usize; let mut flock: libc::flock = unsafe { - mem::zeroed() // required for Linux/mips + mem::zeroed() // required for Linux/mips }; flock.l_type = libc::F_RDLCK as libc::c_short; flock.l_whence = libc::SEEK_SET as libc::c_short; @@ -451,7 +435,10 @@ mod linux_android { #[cfg(all(target_os = "linux", not(target_env = "musl")))] fn lock_info(inode: usize) -> Option<(String, String)> { - use std::{fs::File, io::BufReader}; + use std::{ + fs::File, + io::BufReader + }; let file = File::open("/proc/locks").expect("open /proc/locks failed"); let buf = BufReader::new(file); @@ -471,63 +458,52 @@ mod linux_android { } } -#[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "wasi", - target_env = "uclibc", - target_os = "freebsd" -))] +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd"))] mod test_posix_fadvise { + use tempfile::NamedTempFile; + use std::os::unix::io::{RawFd, AsRawFd}; use nix::errno::Errno; use nix::fcntl::*; use nix::unistd::pipe; - use std::os::unix::io::{AsRawFd, RawFd}; - use tempfile::NamedTempFile; #[test] fn test_success() { let tmp = NamedTempFile::new().unwrap(); let fd = tmp.as_raw_fd(); - posix_fadvise(fd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED) - .expect("posix_fadvise failed"); + let res = posix_fadvise(fd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); + + assert!(res.is_ok()); } #[test] fn test_errno() { let (rd, _wr) = pipe().unwrap(); - let res = posix_fadvise( - rd as RawFd, - 0, - 100, - PosixFadviseAdvice::POSIX_FADV_WILLNEED, - ); + let res = posix_fadvise(rd as RawFd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); assert_eq!(res, Err(Errno::ESPIPE)); } } -#[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "dragonfly", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "wasi", - target_os = "freebsd" -))] +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_os = "freebsd"))] mod test_posix_fallocate { + use tempfile::NamedTempFile; + use std::{io::Read, os::unix::io::{RawFd, AsRawFd}}; use nix::errno::Errno; use nix::fcntl::*; use nix::unistd::pipe; - use std::{ - io::Read, - os::unix::io::{AsRawFd, RawFd}, - }; - use tempfile::NamedTempFile; #[test] fn success() { @@ -559,7 +535,11 @@ mod test_posix_fallocate { let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err(); match err { Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (), - errno => panic!("unexpected errno {}", errno,), + errno => + panic!( + "unexpected errno {}", + errno, + ), } } } diff --git a/bash-5.1/vendor/nix/test/test_kmod/mod.rs b/bash-5.1/vendor/nix/test/test_kmod/mod.rs index 5ebc2423db7edb66fa81d2d3ca2b13a5f4e96100..8eef5384a36e258d4970f98a67ecb055448c6222 100644 --- a/bash-5.1/vendor/nix/test/test_kmod/mod.rs +++ b/bash-5.1/vendor/nix/test/test_kmod/mod.rs @@ -1,25 +1,22 @@ -use crate::*; use std::fs::copy; use std::path::PathBuf; use std::process::Command; use tempfile::{tempdir, TempDir}; +use crate::*; fn compile_kernel_module() -> (PathBuf, String, TempDir) { let _m = crate::FORK_MTX.lock(); - let tmp_dir = - tempdir().expect("unable to create temporary build directory"); + let tmp_dir = tempdir().expect("unable to create temporary build directory"); copy( "test/test_kmod/hello_mod/hello.c", &tmp_dir.path().join("hello.c"), - ) - .expect("unable to copy hello.c to temporary build directory"); + ).expect("unable to copy hello.c to temporary build directory"); copy( "test/test_kmod/hello_mod/Makefile", &tmp_dir.path().join("Makefile"), - ) - .expect("unable to copy Makefile to temporary build directory"); + ).expect("unable to copy Makefile to temporary build directory"); let status = Command::new("make") .current_dir(tmp_dir.path()) @@ -54,16 +51,12 @@ fn test_finit_and_delete_module() { delete_module( &CString::new(kmod_name).unwrap(), DeleteModuleFlags::empty(), - ) - .expect("unable to unload kernel module"); + ).expect("unable to unload kernel module"); } #[test] fn test_finit_and_delete_module_with_params() { - require_capability!( - "test_finit_and_delete_module_with_params", - CAP_SYS_MODULE - ); + require_capability!("test_finit_and_delete_module_with_params", CAP_SYS_MODULE); let _m0 = crate::KMOD_MTX.lock(); let _m1 = crate::CWD_LOCK.read(); @@ -74,14 +67,12 @@ fn test_finit_and_delete_module_with_params() { &f, &CString::new("who=Rust number=2018").unwrap(), ModuleInitFlags::empty(), - ) - .expect("unable to load kernel module"); + ).expect("unable to load kernel module"); delete_module( &CString::new(kmod_name).unwrap(), DeleteModuleFlags::empty(), - ) - .expect("unable to unload kernel module"); + ).expect("unable to unload kernel module"); } #[test] @@ -96,22 +87,17 @@ fn test_init_and_delete_module() { let mut contents: Vec = Vec::new(); f.read_to_end(&mut contents) .expect("unable to read kernel module content to buffer"); - init_module(&contents, &CString::new("").unwrap()) - .expect("unable to load kernel module"); + init_module(&contents, &CString::new("").unwrap()).expect("unable to load kernel module"); delete_module( &CString::new(kmod_name).unwrap(), DeleteModuleFlags::empty(), - ) - .expect("unable to unload kernel module"); + ).expect("unable to unload kernel module"); } #[test] fn test_init_and_delete_module_with_params() { - require_capability!( - "test_init_and_delete_module_with_params", - CAP_SYS_MODULE - ); + require_capability!("test_init_and_delete_module_with_params", CAP_SYS_MODULE); let _m0 = crate::KMOD_MTX.lock(); let _m1 = crate::CWD_LOCK.read(); @@ -127,8 +113,7 @@ fn test_init_and_delete_module_with_params() { delete_module( &CString::new(kmod_name).unwrap(), DeleteModuleFlags::empty(), - ) - .expect("unable to unload kernel module"); + ).expect("unable to unload kernel module"); } #[test] @@ -140,18 +125,14 @@ fn test_finit_module_invalid() { let kmod_path = "/dev/zero"; let f = File::open(kmod_path).expect("unable to open kernel module"); - let result = - finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); assert_eq!(result.unwrap_err(), Errno::EINVAL); } #[test] fn test_finit_module_twice_and_delete_module() { - require_capability!( - "test_finit_module_twice_and_delete_module", - CAP_SYS_MODULE - ); + require_capability!("test_finit_module_twice_and_delete_module", CAP_SYS_MODULE); let _m0 = crate::KMOD_MTX.lock(); let _m1 = crate::CWD_LOCK.read(); @@ -161,16 +142,14 @@ fn test_finit_module_twice_and_delete_module() { finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) .expect("unable to load kernel module"); - let result = - finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); assert_eq!(result.unwrap_err(), Errno::EEXIST); delete_module( &CString::new(kmod_name).unwrap(), DeleteModuleFlags::empty(), - ) - .expect("unable to unload kernel module"); + ).expect("unable to unload kernel module"); } #[test] @@ -179,10 +158,7 @@ fn test_delete_module_not_loaded() { let _m0 = crate::KMOD_MTX.lock(); let _m1 = crate::CWD_LOCK.read(); - let result = delete_module( - &CString::new("hello").unwrap(), - DeleteModuleFlags::empty(), - ); + let result = delete_module(&CString::new("hello").unwrap(), DeleteModuleFlags::empty()); assert_eq!(result.unwrap_err(), Errno::ENOENT); } diff --git a/bash-5.1/vendor/nix/test/test_mount.rs b/bash-5.1/vendor/nix/test/test_mount.rs index febcadfbca07db11ee59409d8019a05fc11b9626..1ddfcfe932e02a234395e5b43111df70ed3fd939 100644 --- a/bash-5.1/vendor/nix/test/test_mount.rs +++ b/bash-5.1/vendor/nix/test/test_mount.rs @@ -27,18 +27,16 @@ exit 23"; const EXPECTED_STATUS: i32 = 23; const NONE: Option<&'static [u8]> = None; - #[allow(clippy::bind_instead_of_map)] // False positive + #[allow(clippy::bind_instead_of_map)] // False positive pub fn test_mount_tmpfs_without_flags_allows_rwx() { let tempdir = tempfile::tempdir().unwrap(); - mount( - NONE, - tempdir.path(), - Some(b"tmpfs".as_ref()), - MsFlags::empty(), - NONE, - ) - .unwrap_or_else(|e| panic!("mount failed: {}", e)); + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::empty(), + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); let test_path = tempdir.path().join("test"); @@ -48,10 +46,8 @@ exit 23"; .write(true) .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) .open(&test_path) - .or_else(|e| { - if Errno::from_i32(e.raw_os_error().unwrap()) - == Errno::EOVERFLOW - { + .or_else(|e| + if Errno::from_i32(e.raw_os_error().unwrap()) == Errno::EOVERFLOW { // Skip tests on certain Linux kernels which have a bug // regarding tmpfs in namespaces. // Ubuntu 14.04 and 16.04 are known to be affected; 16.10 is @@ -60,16 +56,13 @@ exit 23"; // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 let stderr = io::stderr(); let mut handle = stderr.lock(); - writeln!( - handle, - "Buggy Linux kernel detected. Skipping test." - ) + writeln!(handle, "Buggy Linux kernel detected. Skipping test.") .unwrap(); process::exit(0); - } else { - panic!("open failed: {}", e); - } - }) + } else { + panic!("open failed: {}", e); + } + ) .and_then(|mut f| f.write(SCRIPT_CONTENTS)) .unwrap_or_else(|e| panic!("write failed: {}", e)); @@ -81,55 +74,42 @@ exit 23"; assert_eq!(buf, SCRIPT_CONTENTS); // Verify execute. - assert_eq!( - EXPECTED_STATUS, - Command::new(&test_path) - .status() - .unwrap_or_else(|e| panic!("exec failed: {}", e)) - .code() - .unwrap_or_else(|| panic!("child killed by signal")) - ); - - umount(tempdir.path()) - .unwrap_or_else(|e| panic!("umount failed: {}", e)); + assert_eq!(EXPECTED_STATUS, + Command::new(&test_path) + .status() + .unwrap_or_else(|e| panic!("exec failed: {}", e)) + .code() + .unwrap_or_else(|| panic!("child killed by signal"))); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); } pub fn test_mount_rdonly_disallows_write() { let tempdir = tempfile::tempdir().unwrap(); - mount( - NONE, - tempdir.path(), - Some(b"tmpfs".as_ref()), - MsFlags::MS_RDONLY, - NONE, - ) - .unwrap_or_else(|e| panic!("mount failed: {}", e)); + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_RDONLY, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); // EROFS: Read-only file system - assert_eq!( - EROFS as i32, - File::create(tempdir.path().join("test")) - .unwrap_err() - .raw_os_error() - .unwrap() - ); - - umount(tempdir.path()) - .unwrap_or_else(|e| panic!("umount failed: {}", e)); + assert_eq!(EROFS as i32, + File::create(tempdir.path().join("test")).unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); } pub fn test_mount_noexec_disallows_exec() { let tempdir = tempfile::tempdir().unwrap(); - mount( - NONE, - tempdir.path(), - Some(b"tmpfs".as_ref()), - MsFlags::MS_NOEXEC, - NONE, - ) - .unwrap_or_else(|e| panic!("mount failed: {}", e)); + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_NOEXEC, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); let test_path = tempdir.path().join("test"); @@ -142,30 +122,21 @@ exit 23"; .unwrap_or_else(|e| panic!("write failed: {}", e)); // Verify that we cannot execute despite a+x permissions being set. - let mode = stat::Mode::from_bits_truncate( - fs::metadata(&test_path) - .map(|md| md.permissions().mode()) - .unwrap_or_else(|e| panic!("metadata failed: {}", e)), - ); - - assert!( - mode.contains(Mode::S_IXUSR | Mode::S_IXGRP | Mode::S_IXOTH), - "{:?} did not have execute permissions", - &test_path - ); + let mode = stat::Mode::from_bits_truncate(fs::metadata(&test_path) + .map(|md| md.permissions().mode()) + .unwrap_or_else(|e| { + panic!("metadata failed: {}", e) + })); + + assert!(mode.contains(Mode::S_IXUSR | Mode::S_IXGRP | Mode::S_IXOTH), + "{:?} did not have execute permissions", + &test_path); // EACCES: Permission denied - assert_eq!( - EACCES as i32, - Command::new(&test_path) - .status() - .unwrap_err() - .raw_os_error() - .unwrap() - ); - - umount(tempdir.path()) - .unwrap_or_else(|e| panic!("umount failed: {}", e)); + assert_eq!(EACCES as i32, + Command::new(&test_path).status().unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); } pub fn test_mount_bind() { @@ -175,14 +146,12 @@ exit 23"; { let mount_point = tempfile::tempdir().unwrap(); - mount( - Some(tempdir.path()), - mount_point.path(), - NONE, - MsFlags::MS_BIND, - NONE, - ) - .unwrap_or_else(|e| panic!("mount failed: {}", e)); + mount(Some(tempdir.path()), + mount_point.path(), + NONE, + MsFlags::MS_BIND, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); fs::OpenOptions::new() .create(true) @@ -192,8 +161,7 @@ exit 23"; .and_then(|mut f| f.write(SCRIPT_CONTENTS)) .unwrap_or_else(|e| panic!("write failed: {}", e)); - umount(mount_point.path()) - .unwrap_or_else(|e| panic!("umount failed: {}", e)); + umount(mount_point.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); } // Verify the file written in the mount shows up in source directory, even @@ -231,6 +199,7 @@ exit 23"; } } + // Test runner /// Mimic normal test output (hackishly). @@ -251,20 +220,16 @@ macro_rules! run_tests { #[cfg(target_os = "linux")] fn main() { - use test_mount::{ - setup_namespaces, test_mount_bind, test_mount_noexec_disallows_exec, - test_mount_rdonly_disallows_write, - test_mount_tmpfs_without_flags_allows_rwx, - }; + use test_mount::{setup_namespaces, test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, test_mount_noexec_disallows_exec, + test_mount_bind}; skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1351"); setup_namespaces(); - run_tests!( - test_mount_tmpfs_without_flags_allows_rwx, - test_mount_rdonly_disallows_write, - test_mount_noexec_disallows_exec, - test_mount_bind - ); + run_tests!(test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, + test_mount_noexec_disallows_exec, + test_mount_bind); } #[cfg(not(target_os = "linux"))] diff --git a/bash-5.1/vendor/nix/test/test_mq.rs b/bash-5.1/vendor/nix/test/test_mq.rs index 7b48e7ac78f067c2e7f876f3087543cf7c029e2b..8aff840ddc57ae2989334916130eb34e1cc84f6f 100644 --- a/bash-5.1/vendor/nix/test/test_mq.rs +++ b/bash-5.1/vendor/nix/test/test_mq.rs @@ -3,8 +3,8 @@ use std::ffi::CString; use std::str; use nix::errno::Errno; -use nix::mqueue::{mq_attr_member_t, mq_close, mq_open, mq_receive, mq_send}; -use nix::mqueue::{MQ_OFlag, MqAttr}; +use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive, mq_attr_member_t}; +use nix::mqueue::{MqAttr, MQ_OFlag}; use nix::sys::stat::Mode; // Defined as a macro such that the error source is reported as the caller's location. @@ -29,8 +29,8 @@ macro_rules! assert_attr_eq { #[test] fn test_mq_send_and_receive() { const MSG_SIZE: mq_attr_member_t = 32; - let attr = MqAttr::new(0, 10, MSG_SIZE, 0); - let mq_name = &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); + let attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name= &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; @@ -55,11 +55,12 @@ fn test_mq_send_and_receive() { assert_eq!(msg_to_send, str::from_utf8(&buf[0..len]).unwrap()); } + #[test] fn test_mq_getattr() { use nix::mqueue::mq_getattr; const MSG_SIZE: mq_attr_member_t = 32; - let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; @@ -77,14 +78,15 @@ fn test_mq_getattr() { // FIXME: Fix failures for mips in QEMU #[test] -#[cfg_attr( - all(qemu, any(target_arch = "mips", target_arch = "mips64")), - ignore +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore )] fn test_mq_setattr() { use nix::mqueue::{mq_getattr, mq_setattr}; const MSG_SIZE: mq_attr_member_t = 32; - let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; @@ -107,12 +109,7 @@ fn test_mq_setattr() { assert_ne!(new_attr_get, new_attr); } - let new_attr_non_blocking = MqAttr::new( - MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, - 10, - MSG_SIZE, - 0, - ); + let new_attr_non_blocking = MqAttr::new(MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, 10, MSG_SIZE, 0); mq_setattr(&mqd, &new_attr_non_blocking).unwrap(); let new_attr_get = mq_getattr(&mqd).unwrap(); @@ -127,14 +124,15 @@ fn test_mq_setattr() { // FIXME: Fix failures for mips in QEMU #[test] -#[cfg_attr( - all(qemu, any(target_arch = "mips", target_arch = "mips64")), - ignore +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore )] fn test_mq_set_nonblocking() { - use nix::mqueue::{mq_getattr, mq_remove_nonblock, mq_set_nonblock}; + use nix::mqueue::{mq_getattr, mq_set_nonblock, mq_remove_nonblock}; const MSG_SIZE: mq_attr_member_t = 32; - let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; @@ -158,11 +156,10 @@ fn test_mq_set_nonblocking() { fn test_mq_unlink() { use nix::mqueue::mq_unlink; const MSG_SIZE: mq_attr_member_t = 32; - let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); let mq_name_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] - let mq_name_not_opened = - &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + let mq_name_not_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; let r = mq_open(mq_name_opened, oflag, mode, Some(&initial_attr)); @@ -173,7 +170,7 @@ fn test_mq_unlink() { let mqd = r.unwrap(); let res_unlink = mq_unlink(mq_name_opened); - assert_eq!(res_unlink, Ok(())); + assert_eq!(res_unlink, Ok(()) ); // NetBSD (and others which inherit its implementation) defer removing the message // queue name until all references are closed, whereas Linux and others remove the @@ -181,10 +178,10 @@ fn test_mq_unlink() { #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] { let res_unlink_not_opened = mq_unlink(mq_name_not_opened); - assert_eq!(res_unlink_not_opened, Err(Errno::ENOENT)); + assert_eq!(res_unlink_not_opened, Err(Errno::ENOENT) ); } mq_close(mqd).unwrap(); let res_unlink_after_close = mq_unlink(mq_name_opened); - assert_eq!(res_unlink_after_close, Err(Errno::ENOENT)); + assert_eq!(res_unlink_after_close, Err(Errno::ENOENT) ); } diff --git a/bash-5.1/vendor/nix/test/test_net.rs b/bash-5.1/vendor/nix/test/test_net.rs index c44655a4c9b6368069c9c7e3d8dac32a0d0581d7..40ecd6bb754fae5eb0a55d650ec64f37dc93c3d7 100644 --- a/bash-5.1/vendor/nix/test/test_net.rs +++ b/bash-5.1/vendor/nix/test/test_net.rs @@ -3,17 +3,10 @@ use nix::net::if_::*; #[cfg(any(target_os = "android", target_os = "linux"))] const LOOPBACK: &[u8] = b"lo"; -#[cfg(not(any( - target_os = "android", - target_os = "linux", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "android", target_os = "linux")))] const LOOPBACK: &[u8] = b"lo0"; -#[cfg(target_os = "haiku")] -const LOOPBACK: &[u8] = b"loop"; - #[test] fn test_if_nametoindex() { - if_nametoindex(LOOPBACK).expect("assertion failed"); + assert!(if_nametoindex(LOOPBACK).is_ok()); } diff --git a/bash-5.1/vendor/nix/test/test_nix_path.rs b/bash-5.1/vendor/nix/test/test_nix_path.rs index 8b137891791fe96927ad78e64b0aad7bded08bdc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/bash-5.1/vendor/nix/test/test_nix_path.rs +++ b/bash-5.1/vendor/nix/test/test_nix_path.rs @@ -1 +0,0 @@ - diff --git a/bash-5.1/vendor/nix/test/test_nmount.rs b/bash-5.1/vendor/nix/test/test_nmount.rs index dec806a55fb1a69541b3d246faacaf2821304c40..4c74ecf627330c781efcd0d0ddd601abc626da01 100644 --- a/bash-5.1/vendor/nix/test/test_nmount.rs +++ b/bash-5.1/vendor/nix/test/test_nmount.rs @@ -1,9 +1,13 @@ use crate::*; use nix::{ errno::Errno, - mount::{unmount, MntFlags, Nmount}, + mount::{MntFlags, Nmount, unmount} +}; +use std::{ + ffi::CString, + fs::File, + path::Path }; -use std::{ffi::CString, fs::File, path::Path}; use tempfile::tempdir; #[test] @@ -20,15 +24,14 @@ fn ok() { .str_opt(&fstype, &nullfs) .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) .str_opt_owned("target", target.path().to_str().unwrap()) - .nmount(MntFlags::empty()) - .unwrap(); - + .nmount(MntFlags::empty()).unwrap(); + // Now check that the sentry is visible through the mountpoint let exists = Path::exists(&mountpoint.path().join("sentry")); // Cleanup the mountpoint before asserting unmount(mountpoint.path(), MntFlags::empty()).unwrap(); - + assert!(exists); } @@ -41,9 +44,8 @@ fn bad_fstype() { let e = Nmount::new() .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) .str_opt_owned("target", target.path().to_str().unwrap()) - .nmount(MntFlags::empty()) - .unwrap_err(); - + .nmount(MntFlags::empty()).unwrap_err(); + assert_eq!(e.error(), Errno::EINVAL); assert_eq!(e.errmsg(), Some("Invalid fstype")); } diff --git a/bash-5.1/vendor/nix/test/test_poll.rs b/bash-5.1/vendor/nix/test/test_poll.rs index 53964e26bbcc5fc0589f853c216630505f329596..e4b369f3f2a0201aa984624e0831bae85a5d5268 100644 --- a/bash-5.1/vendor/nix/test/test_poll.rs +++ b/bash-5.1/vendor/nix/test/test_poll.rs @@ -1,7 +1,7 @@ use nix::{ errno::Errno, - poll::{poll, PollFd, PollFlags}, - unistd::{pipe, write}, + poll::{PollFlags, poll, PollFd}, + unistd::{write, pipe} }; macro_rules! loop_while_eintr { @@ -10,10 +10,10 @@ macro_rules! loop_while_eintr { match $poll_expr { Ok(nfds) => break nfds, Err(Errno::EINTR) => (), - Err(e) => panic!("{}", e), + Err(e) => panic!("{}", e) } } - }; + } } #[test] @@ -37,12 +37,10 @@ fn test_poll() { // ppoll(2) is the same as poll except for how it handles timeouts and signals. // Repeating the test for poll(2) should be sufficient to check that our // bindings are correct. -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] #[test] fn test_ppoll() { use nix::poll::ppoll; @@ -55,14 +53,14 @@ fn test_ppoll() { // Poll an idle pipe. Should timeout let sigset = SigSet::empty(); - let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), Some(sigset))); + let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), sigset)); assert_eq!(nfds, 0); assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); write(w, b".").unwrap(); // Poll a readable pipe. Should return an event. - let nfds = ppoll(&mut fds, Some(timeout), None).unwrap(); + let nfds = ppoll(&mut fds, Some(timeout), SigSet::empty()).unwrap(); assert_eq!(nfds, 1); assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); } diff --git a/bash-5.1/vendor/nix/test/test_pty.rs b/bash-5.1/vendor/nix/test/test_pty.rs index 5c27e2d632de8a7d66ce74ad8ffd6758c17bee90..1a7cab81a041c734b76c3e2234cbb6013a739656 100644 --- a/bash-5.1/vendor/nix/test/test_pty.rs +++ b/bash-5.1/vendor/nix/test/test_pty.rs @@ -1,15 +1,15 @@ use std::fs::File; use std::io::{Read, Write}; -use std::os::unix::prelude::*; use std::path::Path; +use std::os::unix::prelude::*; use tempfile::tempfile; use libc::{_exit, STDOUT_FILENO}; -use nix::fcntl::{open, OFlag}; +use nix::fcntl::{OFlag, open}; use nix::pty::*; use nix::sys::stat; use nix::sys::termios::*; -use nix::unistd::{close, pause, write}; +use nix::unistd::{write, close, pause}; /// Regression test for Issue #659 /// This is the correct way to explicitly close a `PtyMaster` @@ -36,7 +36,7 @@ fn test_ptsname_equivalence() { assert!(master_fd.as_raw_fd() > 0); // Get the name of the slave - let slave_name = unsafe { ptsname(&master_fd) }.unwrap(); + let slave_name = unsafe { ptsname(&master_fd) }.unwrap() ; let slave_name_r = ptsname_r(&master_fd).unwrap(); assert_eq!(slave_name, slave_name_r); } @@ -58,7 +58,7 @@ fn test_ptsname_copy() { assert_eq!(slave_name1, slave_name2); // Also make sure that the string was actually copied and they point to different parts of // memory. - assert_ne!(slave_name1.as_ptr(), slave_name2.as_ptr()); + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); } /// Test data copying of `ptsname_r` @@ -73,7 +73,7 @@ fn test_ptsname_r_copy() { let slave_name1 = ptsname_r(&master_fd).unwrap(); let slave_name2 = ptsname_r(&master_fd).unwrap(); assert_eq!(slave_name1, slave_name2); - assert_ne!(slave_name1.as_ptr(), slave_name2.as_ptr()); + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); } /// Test that `ptsname` returns different names for different devices @@ -93,7 +93,7 @@ fn test_ptsname_unique() { // Get the name of the slave let slave_name1 = unsafe { ptsname(&master1_fd) }.unwrap(); let slave_name2 = unsafe { ptsname(&master2_fd) }.unwrap(); - assert_ne!(slave_name1, slave_name2); + assert!(slave_name1 != slave_name2); } /// Common setup for testing PTTY pairs @@ -111,9 +111,7 @@ fn open_ptty_pair() -> (PtyMaster, File) { let slave_name = unsafe { ptsname(&master) }.expect("ptsname failed"); // Open the slave device - let slave_fd = - open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()) - .unwrap(); + let slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()).unwrap(); #[cfg(target_os = "illumos")] // TODO: rewrite using ioctl! @@ -281,9 +279,9 @@ fn test_openpty_with_termios() { #[test] fn test_forkpty() { + use nix::unistd::ForkResult::*; use nix::sys::signal::*; use nix::sys::wait::wait; - use nix::unistd::ForkResult::*; // forkpty calls openpty which uses ptname(3) internally. let _m0 = crate::PTSNAME_MTX.lock(); // forkpty spawns a child process @@ -291,15 +289,15 @@ fn test_forkpty() { let string = "naninani\n"; let echoed_string = "naninani\r\n"; - let pty = unsafe { forkpty(None, None).unwrap() }; + let pty = unsafe { + forkpty(None, None).unwrap() + }; match pty.fork_result { Child => { write(STDOUT_FILENO, string.as_bytes()).unwrap(); - pause(); // we need the child to stay alive until the parent calls read - unsafe { - _exit(0); - } - } + pause(); // we need the child to stay alive until the parent calls read + unsafe { _exit(0); } + }, Parent { child } => { let mut buf = [0u8; 10]; assert!(child.as_raw() > 0); @@ -308,6 +306,6 @@ fn test_forkpty() { wait().unwrap(); // keep other tests using generic wait from getting our child assert_eq!(&buf, echoed_string.as_bytes()); close(pty.master).unwrap(); - } + }, } } diff --git a/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs b/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs index ffbaa5697771ad20419a8e78f72c8546cc4e93df..a68f81ee1e24f59c387587c389d4a33245da34ca 100644 --- a/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs +++ b/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs @@ -15,6 +15,6 @@ mod t { fn test_double_close() { let m = posix_openpt(OFlag::O_RDWR).unwrap(); close(m.as_raw_fd()).unwrap(); - drop(m); // should panic here + drop(m); // should panic here } } diff --git a/bash-5.1/vendor/nix/test/test_resource.rs b/bash-5.1/vendor/nix/test/test_resource.rs index 2ab581ba2940326f6a37d8abcef2eb59cb173db7..c89d601e278970dca93a7851cfb8679f4d9ece59 100644 --- a/bash-5.1/vendor/nix/test/test_resource.rs +++ b/bash-5.1/vendor/nix/test/test_resource.rs @@ -1,9 +1,4 @@ -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "illumos", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] use nix::sys::resource::{getrlimit, setrlimit, Resource}; /// Tests the RLIMIT_NOFILE functionality of getrlimit(), where the resource RLIMIT_NOFILE refers @@ -15,15 +10,9 @@ use nix::sys::resource::{getrlimit, setrlimit, Resource}; /// to put the new soft limit in effect, and then getrlimit() once more to ensure the limits have /// been updated. #[test] -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "illumos", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] pub fn test_resource_limits_nofile() { - let (mut soft_limit, hard_limit) = - getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + let (mut soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); soft_limit -= 1; assert_ne!(soft_limit, hard_limit); diff --git a/bash-5.1/vendor/nix/test/test_sched.rs b/bash-5.1/vendor/nix/test/test_sched.rs index ebf346db16d2d3d382762fb4cf2edd0dbf6c87ef..922196a3dba73b96a97b32e9227f1103b3b6ed09 100644 --- a/bash-5.1/vendor/nix/test/test_sched.rs +++ b/bash-5.1/vendor/nix/test/test_sched.rs @@ -24,10 +24,7 @@ fn test_sched_affinity() { let updated_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); for field in 0..CpuSet::count() { // Should be set only for the CPU we set previously - assert_eq!( - updated_affinity.is_set(field).unwrap(), - field == last_valid_cpu - ) + assert_eq!(updated_affinity.is_set(field).unwrap(), field==last_valid_cpu) } // Finally, reset the initial CPU set diff --git a/bash-5.1/vendor/nix/test/test_sendfile.rs b/bash-5.1/vendor/nix/test/test_sendfile.rs index f73a3b56c38b5a93361a3f911a4f7967eb06afef..e56ff12faf7623990fd8c8ed0064e79900a42e9c 100644 --- a/bash-5.1/vendor/nix/test/test_sendfile.rs +++ b/bash-5.1/vendor/nix/test/test_sendfile.rs @@ -62,8 +62,7 @@ fn test_sendfile64_linux() { #[test] fn test_sendfile_freebsd() { // Declare the content - let header_strings = - vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; let body = "Xabcdef123456"; let body_offset = 1; let trailer_strings = vec!["\n", "Served by Make Believe\n"]; @@ -73,10 +72,8 @@ fn test_sendfile_freebsd() { tmp.write_all(body.as_bytes()).unwrap(); // Prepare headers and trailers for sendfile - let headers: Vec<&[u8]> = - header_strings.iter().map(|s| s.as_bytes()).collect(); - let trailers: Vec<&[u8]> = - trailer_strings.iter().map(|s| s.as_bytes()).collect(); + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); // Prepare socket pair let (mut rd, wr) = UnixStream::pair().unwrap(); @@ -96,9 +93,8 @@ fn test_sendfile_freebsd() { wr.shutdown(Shutdown::Both).unwrap(); // Prepare the expected result - let expected_string = header_strings.concat() - + &body[body_offset..] - + &trailer_strings.concat(); + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); // Verify the message that was sent assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); @@ -113,8 +109,7 @@ fn test_sendfile_freebsd() { #[test] fn test_sendfile_dragonfly() { // Declare the content - let header_strings = - vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; let body = "Xabcdef123456"; let body_offset = 1; let trailer_strings = vec!["\n", "Served by Make Believe\n"]; @@ -124,10 +119,8 @@ fn test_sendfile_dragonfly() { tmp.write_all(body.as_bytes()).unwrap(); // Prepare headers and trailers for sendfile - let headers: Vec<&[u8]> = - header_strings.iter().map(|s| s.as_bytes()).collect(); - let trailers: Vec<&[u8]> = - trailer_strings.iter().map(|s| s.as_bytes()).collect(); + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); // Prepare socket pair let (mut rd, wr) = UnixStream::pair().unwrap(); @@ -145,9 +138,8 @@ fn test_sendfile_dragonfly() { wr.shutdown(Shutdown::Both).unwrap(); // Prepare the expected result - let expected_string = header_strings.concat() - + &body[body_offset..] - + &trailer_strings.concat(); + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); // Verify the message that was sent assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); @@ -162,8 +154,7 @@ fn test_sendfile_dragonfly() { #[test] fn test_sendfile_darwin() { // Declare the content - let header_strings = - vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; let body = "Xabcdef123456"; let body_offset = 1; let trailer_strings = vec!["\n", "Served by Make Believe\n"]; @@ -173,10 +164,8 @@ fn test_sendfile_darwin() { tmp.write_all(body.as_bytes()).unwrap(); // Prepare headers and trailers for sendfile - let headers: Vec<&[u8]> = - header_strings.iter().map(|s| s.as_bytes()).collect(); - let trailers: Vec<&[u8]> = - trailer_strings.iter().map(|s| s.as_bytes()).collect(); + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); // Prepare socket pair let (mut rd, wr) = UnixStream::pair().unwrap(); @@ -194,9 +183,8 @@ fn test_sendfile_darwin() { wr.shutdown(Shutdown::Both).unwrap(); // Prepare the expected result - let expected_string = header_strings.concat() - + &body[body_offset..] - + &trailer_strings.concat(); + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); // Verify the message that was sent assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); diff --git a/bash-5.1/vendor/nix/test/test_stat.rs b/bash-5.1/vendor/nix/test/test_stat.rs index 55f15c0771d0f24114fe30c9feebc4d07271e066..8baa6555b690b16b6db637ee5f1617f588271e71 100644 --- a/bash-5.1/vendor/nix/test/test_stat.rs +++ b/bash-5.1/vendor/nix/test/test_stat.rs @@ -1,51 +1,42 @@ -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] use std::fs; use std::fs::File; #[cfg(not(target_os = "redox"))] -use std::os::unix::fs::symlink; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -use std::os::unix::fs::PermissionsExt; +use std::os::unix::fs::{symlink, PermissionsExt}; use std::os::unix::prelude::AsRawFd; #[cfg(not(target_os = "redox"))] -use std::path::Path; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] use std::time::{Duration, UNIX_EPOCH}; +#[cfg(not(target_os = "redox"))] +use std::path::Path; -use libc::mode_t; #[cfg(not(any(target_os = "netbsd", target_os = "redox")))] -use libc::{S_IFLNK, S_IFMT}; +use libc::{S_IFMT, S_IFLNK}; +use libc::mode_t; -#[cfg(not(target_os = "redox"))] -use nix::errno::Errno; #[cfg(not(target_os = "redox"))] use nix::fcntl; -#[cfg(any( - target_os = "linux", - target_os = "ios", - target_os = "macos", - target_os = "freebsd", - target_os = "netbsd" -))] -use nix::sys::stat::lutimes; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -use nix::sys::stat::utimensat; #[cfg(not(target_os = "redox"))] -use nix::sys::stat::FchmodatFlags; -use nix::sys::stat::Mode; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -use nix::sys::stat::UtimensatFlags; +use nix::errno::Errno; #[cfg(not(target_os = "redox"))] -use nix::sys::stat::{self}; +use nix::sys::stat::{self, futimens, utimes}; use nix::sys::stat::{fchmod, stat}; #[cfg(not(target_os = "redox"))] -use nix::sys::stat::{fchmodat, mkdirat}; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -use nix::sys::stat::{futimens, utimes}; +use nix::sys::stat::{fchmodat, utimensat, mkdirat}; +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +use nix::sys::stat::lutimes; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{FchmodatFlags, UtimensatFlags}; +use nix::sys::stat::Mode; #[cfg(not(any(target_os = "netbsd", target_os = "redox")))] use nix::sys::stat::FileStat; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] use nix::sys::time::{TimeSpec, TimeVal, TimeValLike}; #[cfg(not(target_os = "redox"))] use nix::unistd::chdir; @@ -56,35 +47,32 @@ use nix::Result; #[cfg(not(any(target_os = "netbsd", target_os = "redox")))] fn assert_stat_results(stat_result: Result) { let stats = stat_result.expect("stat call failed"); - assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent - assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent - assert!(stats.st_mode > 0); // must be positive integer - assert_eq!(stats.st_nlink, 1); // there links created, must be 1 - assert_eq!(stats.st_size, 0); // size is 0 because we did not write anything to the file - assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent - assert!(stats.st_blocks <= 16); // Up to 16 blocks can be allocated for a blank file + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert_eq!(stats.st_size, 0); // size is 0 because we did not write anything to the file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_blocks <= 16); // Up to 16 blocks can be allocated for a blank file } #[cfg(not(any(target_os = "netbsd", target_os = "redox")))] // (Android's st_blocks is ulonglong which is always non-negative.) #[cfg_attr(target_os = "android", allow(unused_comparisons))] -#[allow(clippy::absurd_extreme_comparisons)] // Not absurd on all OSes +#[allow(clippy::absurd_extreme_comparisons)] // Not absurd on all OSes fn assert_lstat_results(stat_result: Result) { let stats = stat_result.expect("stat call failed"); - assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent - assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent - assert!(stats.st_mode > 0); // must be positive integer + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer // st_mode is c_uint (u32 on Android) while S_IFMT is mode_t // (u16 on Android), and that will be a compile error. // On other platforms they are the same (either both are u16 or u32). - assert_eq!( - (stats.st_mode as usize) & (S_IFMT as usize), - S_IFLNK as usize - ); // should be a link - assert_eq!(stats.st_nlink, 1); // there links created, must be 1 - assert!(stats.st_size > 0); // size is > 0 because it points to another file - assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + assert_eq!((stats.st_mode as usize) & (S_IFMT as usize), S_IFLNK as usize); // should be a link + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert!(stats.st_size > 0); // size is > 0 because it points to another file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent // st_blocks depends on whether the machine's file system uses fast // or slow symlinks, so just make sure it's not negative @@ -113,11 +101,13 @@ fn test_fstatat() { let tempdir = tempfile::tempdir().unwrap(); let filename = tempdir.path().join("foo.txt"); File::create(&filename).unwrap(); - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()); + let dirfd = fcntl::open(tempdir.path(), + fcntl::OFlag::empty(), + stat::Mode::empty()); - let result = - stat::fstatat(dirfd.unwrap(), &filename, fcntl::AtFlags::empty()); + let result = stat::fstatat(dirfd.unwrap(), + &filename, + fcntl::AtFlags::empty()); assert_stat_results(result); } @@ -177,15 +167,12 @@ fn test_fchmodat() { let fullpath = tempdir.path().join(filename); File::create(&fullpath).unwrap(); - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); let mut mode1 = Mode::empty(); mode1.insert(Mode::S_IRUSR); mode1.insert(Mode::S_IWUSR); - fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink) - .unwrap(); + fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink).unwrap(); let file_stat1 = stat(&fullpath).unwrap(); assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); @@ -204,42 +191,34 @@ fn test_fchmodat() { /// /// The atime and mtime are expressed with a resolution of seconds because some file systems /// (like macOS's HFS+) do not have higher granularity. -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -fn assert_times_eq( - exp_atime_sec: u64, - exp_mtime_sec: u64, - attr: &fs::Metadata, -) { +#[cfg(not(target_os = "redox"))] +fn assert_times_eq(exp_atime_sec: u64, exp_mtime_sec: u64, attr: &fs::Metadata) { assert_eq!( Duration::new(exp_atime_sec, 0), - attr.accessed().unwrap().duration_since(UNIX_EPOCH).unwrap() - ); + attr.accessed().unwrap().duration_since(UNIX_EPOCH).unwrap()); assert_eq!( Duration::new(exp_mtime_sec, 0), - attr.modified().unwrap().duration_since(UNIX_EPOCH).unwrap() - ); + attr.modified().unwrap().duration_since(UNIX_EPOCH).unwrap()); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_utimes() { let tempdir = tempfile::tempdir().unwrap(); let fullpath = tempdir.path().join("file"); drop(File::create(&fullpath).unwrap()); - utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)) - .unwrap(); + utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)).unwrap(); assert_times_eq(9990, 5550, &fs::metadata(&fullpath).unwrap()); } #[test] -#[cfg(any( - target_os = "linux", - target_os = "ios", - target_os = "macos", - target_os = "freebsd", - target_os = "netbsd" -))] +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] fn test_lutimes() { let tempdir = tempfile::tempdir().unwrap(); let target = tempdir.path().join("target"); @@ -248,39 +227,31 @@ fn test_lutimes() { symlink(&target, &fullpath).unwrap(); let exp_target_metadata = fs::symlink_metadata(&target).unwrap(); - lutimes(&fullpath, &TimeVal::seconds(4560), &TimeVal::seconds(1230)) - .unwrap(); + lutimes(&fullpath, &TimeVal::seconds(4560), &TimeVal::seconds(1230)).unwrap(); assert_times_eq(4560, 1230, &fs::symlink_metadata(&fullpath).unwrap()); let target_metadata = fs::symlink_metadata(&target).unwrap(); - assert_eq!( - exp_target_metadata.accessed().unwrap(), - target_metadata.accessed().unwrap(), - "atime of symlink target was unexpectedly modified" - ); - assert_eq!( - exp_target_metadata.modified().unwrap(), - target_metadata.modified().unwrap(), - "mtime of symlink target was unexpectedly modified" - ); + assert_eq!(exp_target_metadata.accessed().unwrap(), target_metadata.accessed().unwrap(), + "atime of symlink target was unexpectedly modified"); + assert_eq!(exp_target_metadata.modified().unwrap(), target_metadata.modified().unwrap(), + "mtime of symlink target was unexpectedly modified"); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_futimens() { let tempdir = tempfile::tempdir().unwrap(); let fullpath = tempdir.path().join("file"); drop(File::create(&fullpath).unwrap()); - let fd = fcntl::open(&fullpath, fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let fd = fcntl::open(&fullpath, fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); futimens(fd, &TimeSpec::seconds(10), &TimeSpec::seconds(20)).unwrap(); assert_times_eq(10, 20, &fs::metadata(&fullpath).unwrap()); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_utimensat() { let _dr = crate::DirRestore::new(); let tempdir = tempfile::tempdir().unwrap(); @@ -288,30 +259,16 @@ fn test_utimensat() { let fullpath = tempdir.path().join(filename); drop(File::create(&fullpath).unwrap()); - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); - utimensat( - Some(dirfd), - filename, - &TimeSpec::seconds(12345), - &TimeSpec::seconds(678), - UtimensatFlags::FollowSymlink, - ) - .unwrap(); + utimensat(Some(dirfd), filename, &TimeSpec::seconds(12345), &TimeSpec::seconds(678), + UtimensatFlags::FollowSymlink).unwrap(); assert_times_eq(12345, 678, &fs::metadata(&fullpath).unwrap()); chdir(tempdir.path()).unwrap(); - utimensat( - None, - filename, - &TimeSpec::seconds(500), - &TimeSpec::seconds(800), - UtimensatFlags::FollowSymlink, - ) - .unwrap(); + utimensat(None, filename, &TimeSpec::seconds(500), &TimeSpec::seconds(800), + UtimensatFlags::FollowSymlink).unwrap(); assert_times_eq(500, 800, &fs::metadata(&fullpath).unwrap()); } @@ -320,27 +277,20 @@ fn test_utimensat() { fn test_mkdirat_success_path() { let tempdir = tempfile::tempdir().unwrap(); let filename = "example_subdir"; - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); - mkdirat(dirfd, filename, Mode::S_IRWXU).expect("mkdirat failed"); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); assert!(Path::exists(&tempdir.path().join(filename))); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_mkdirat_success_mode() { - let expected_bits = - stat::SFlag::S_IFDIR.bits() | stat::Mode::S_IRWXU.bits(); + let expected_bits = stat::SFlag::S_IFDIR.bits() | stat::Mode::S_IRWXU.bits(); let tempdir = tempfile::tempdir().unwrap(); let filename = "example_subdir"; - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); - mkdirat(dirfd, filename, Mode::S_IRWXU).expect("mkdirat failed"); - let permissions = fs::metadata(tempdir.path().join(filename)) - .unwrap() - .permissions(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); + let permissions = fs::metadata(tempdir.path().join(filename)).unwrap().permissions(); let mode = permissions.mode(); assert_eq!(mode as mode_t, expected_bits) } @@ -349,27 +299,20 @@ fn test_mkdirat_success_mode() { #[cfg(not(target_os = "redox"))] fn test_mkdirat_fail() { let tempdir = tempfile::tempdir().unwrap(); - let not_dir_filename = "example_not_dir"; + let not_dir_filename= "example_not_dir"; let filename = "example_subdir_dir"; - let dirfd = fcntl::open( - &tempdir.path().join(not_dir_filename), - fcntl::OFlag::O_CREAT, - stat::Mode::empty(), - ) - .unwrap(); + let dirfd = fcntl::open(&tempdir.path().join(not_dir_filename), fcntl::OFlag::O_CREAT, + stat::Mode::empty()).unwrap(); let result = mkdirat(dirfd, filename, Mode::S_IRWXU).unwrap_err(); assert_eq!(result, Errno::ENOTDIR); } #[test] -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "haiku", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] fn test_mknod() { use stat::{lstat, mknod, SFlag}; @@ -378,20 +321,17 @@ fn test_mknod() { let target = tempdir.path().join(file_name); mknod(&target, SFlag::S_IFREG, Mode::S_IRWXU, 0).unwrap(); let mode = lstat(&target).unwrap().st_mode as mode_t; - assert_eq!(mode & libc::S_IFREG, libc::S_IFREG); - assert_eq!(mode & libc::S_IRWXU, libc::S_IRWXU); + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); } #[test] -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "haiku", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] fn test_mknodat() { use fcntl::{AtFlags, OFlag}; use nix::dir::Dir; @@ -399,8 +339,7 @@ fn test_mknodat() { let file_name = "test_file"; let tempdir = tempfile::tempdir().unwrap(); - let target_dir = - Dir::open(tempdir.path(), OFlag::O_DIRECTORY, Mode::S_IRWXU).unwrap(); + let target_dir = Dir::open(tempdir.path(), OFlag::O_DIRECTORY, Mode::S_IRWXU).unwrap(); mknodat( target_dir.as_raw_fd(), file_name, @@ -416,6 +355,6 @@ fn test_mknodat() { ) .unwrap() .st_mode as mode_t; - assert_eq!(mode & libc::S_IFREG, libc::S_IFREG); - assert_eq!(mode & libc::S_IRWXU, libc::S_IRWXU); + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); } diff --git a/bash-5.1/vendor/nix/test/test_time.rs b/bash-5.1/vendor/nix/test/test_time.rs index 5f76e61a2da55169bf718c7ca3ac6cb0b32c04cf..dc307e57b3abf44eef794a6224aeceb19c81ca92 100644 --- a/bash-5.1/vendor/nix/test/test_time.rs +++ b/bash-5.1/vendor/nix/test/test_time.rs @@ -11,12 +11,12 @@ use nix::time::{clock_gettime, ClockId}; #[cfg(not(target_os = "redox"))] #[test] pub fn test_clock_getres() { - nix::time::clock_getres(ClockId::CLOCK_REALTIME).expect("assertion failed"); + assert!(nix::time::clock_getres(ClockId::CLOCK_REALTIME).is_ok()); } #[test] pub fn test_clock_gettime() { - clock_gettime(ClockId::CLOCK_REALTIME).expect("assertion failed"); + assert!(clock_gettime(ClockId::CLOCK_REALTIME).is_ok()); } #[cfg(any( @@ -29,18 +29,18 @@ pub fn test_clock_gettime() { #[test] pub fn test_clock_getcpuclockid() { let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap(); - clock_gettime(clock_id).unwrap(); + assert!(clock_gettime(clock_id).is_ok()); } #[cfg(not(target_os = "redox"))] #[test] pub fn test_clock_id_res() { - ClockId::CLOCK_REALTIME.res().unwrap(); + assert!(ClockId::CLOCK_REALTIME.res().is_ok()); } #[test] pub fn test_clock_id_now() { - ClockId::CLOCK_REALTIME.now().unwrap(); + assert!(ClockId::CLOCK_REALTIME.now().is_ok()); } #[cfg(any( @@ -52,8 +52,7 @@ pub fn test_clock_id_now() { ))] #[test] pub fn test_clock_id_pid_cpu_clock_id() { - ClockId::pid_cpu_clock_id(nix::unistd::Pid::this()) + assert!(ClockId::pid_cpu_clock_id(nix::unistd::Pid::this()) .map(ClockId::now) - .unwrap() - .unwrap(); + .is_ok()); } diff --git a/bash-5.1/vendor/nix/test/test_timer.rs b/bash-5.1/vendor/nix/test/test_timer.rs index ffd146867bd1d119c32918830c5d9a2995b8e8aa..d07d9633d0ab391bfb5b6428abec8cf7f0486c44 100644 --- a/bash-5.1/vendor/nix/test/test_timer.rs +++ b/bash-5.1/vendor/nix/test/test_timer.rs @@ -1,6 +1,5 @@ use nix::sys::signal::{ - sigaction, SaFlags, SigAction, SigEvent, SigHandler, SigSet, SigevNotify, - Signal, + sigaction, SaFlags, SigAction, SigEvent, SigHandler, SigSet, SigevNotify, Signal, }; use nix::sys::timer::{Expiration, Timer, TimerSetTimeFlags}; use nix::time::ClockId; @@ -33,12 +32,9 @@ fn alarm_fires() { // Create a handler for the test signal, `SIG`. The handler is responsible // for flipping `ALARM_CALLED`. let handler = SigHandler::Handler(handle_sigalarm); - let signal_action = - SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); - let old_handler = unsafe { - sigaction(SIG, &signal_action) - .expect("unable to set signal handler for alarm") - }; + let signal_action = SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = + unsafe { sigaction(SIG, &signal_action).expect("unable to set signal handler for alarm") }; // Create the timer. We use the monotonic clock here, though any would do // really. The timer is set to fire every 250 milliseconds with no delay for @@ -48,8 +44,7 @@ fn alarm_fires() { signal: SIG, si_value: 0, }); - let mut timer = - Timer::new(clockid, sigevent).expect("failed to create timer"); + let mut timer = Timer::new(clockid, sigevent).expect("failed to create timer"); let expiration = Expiration::Interval(TIMER_PERIOD.into()); let flags = TimerSetTimeFlags::empty(); timer.set(expiration, flags).expect("could not set timer"); @@ -65,10 +60,12 @@ fn alarm_fires() { // represents a delay to the next expiration. We're only interested in the // timer still being extant. match timer.get() { - Ok(Some(exp)) => assert!(matches!( - exp, - Expiration::Interval(..) | Expiration::IntervalDelayed(..) - )), + Ok(Some(exp)) => { + assert!(matches!( + exp, + Expiration::Interval(..) | Expiration::IntervalDelayed(..) + )) + } _ => panic!("timer lost its expiration"), } diff --git a/bash-5.1/vendor/nix/test/test_unistd.rs b/bash-5.1/vendor/nix/test/test_unistd.rs index eee10103ad6b0808298a899892cebecf6932c70a..0f56b929d30eb36ac3a00dad802a187689b23f9f 100644 --- a/bash-5.1/vendor/nix/test/test_unistd.rs +++ b/bash-5.1/vendor/nix/test/test_unistd.rs @@ -1,24 +1,15 @@ -use libc::{_exit, mode_t, off_t}; -use nix::errno::Errno; -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] -use nix::fcntl::readlink; -use nix::fcntl::OFlag; #[cfg(not(target_os = "redox"))] -use nix::fcntl::{self, open}; -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] -use nix::pty::{grantpt, posix_openpt, ptsname, unlockpt}; +use nix::fcntl::{self, open, readlink}; +use nix::fcntl::OFlag; +use nix::unistd::*; +use nix::unistd::ForkResult::*; #[cfg(not(target_os = "redox"))] -use nix::sys::signal::{ - sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal, -}; -use nix::sys::stat::{self, Mode, SFlag}; +use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}; use nix::sys::wait::*; -use nix::unistd::ForkResult::*; -use nix::unistd::*; +use nix::sys::stat::{self, Mode, SFlag}; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname}; +use nix::errno::Errno; use std::env; #[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] use std::ffi::CString; @@ -27,13 +18,10 @@ use std::fs::DirBuilder; use std::fs::{self, File}; use std::io::Write; use std::os::unix::prelude::*; -#[cfg(not(any( - target_os = "fuchsia", - target_os = "redox", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] use std::path::Path; use tempfile::{tempdir, tempfile}; +use libc::{_exit, mode_t, off_t}; use crate::*; @@ -43,7 +31,7 @@ fn test_fork_and_waitpid() { let _m = crate::FORK_MTX.lock(); // Safe: Child only calls `_exit`, which is signal-safe - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => unsafe { _exit(0) }, Parent { child } => { // assert that child was created and pid > 0 @@ -52,17 +40,16 @@ fn test_fork_and_waitpid() { let wait_status = waitpid(child, None); match wait_status { // assert that waitpid returned correct status and the pid is the one of the child - Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child), + Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child), // panic, must never happen - s @ Ok(_) => { - panic!("Child exited {:?}, should never happen", s) - } + s @ Ok(_) => panic!("Child exited {:?}, should never happen", s), // panic, waitpid should never fail - Err(s) => panic!("Error: waitpid returned Err({:?}", s), + Err(s) => panic!("Error: waitpid returned Err({:?}", s) } - } + + }, } } @@ -72,14 +59,14 @@ fn test_wait() { let _m = crate::FORK_MTX.lock(); // Safe: Child only calls `_exit`, which is signal-safe - match unsafe { fork() }.expect("Error: Fork Failed") { + match unsafe{fork()}.expect("Error: Fork Failed") { Child => unsafe { _exit(0) }, Parent { child } => { let wait_status = wait(); // just assert that (any) one child returns with WaitStatus::Exited assert_eq!(wait_status, Ok(WaitStatus::Exited(child, 0))); - } + }, } } @@ -93,15 +80,15 @@ fn test_mkstemp() { Ok((fd, path)) => { close(fd).unwrap(); unlink(path.as_path()).unwrap(); - } - Err(e) => panic!("mkstemp failed: {}", e), + }, + Err(e) => panic!("mkstemp failed: {}", e) } } #[test] fn test_mkstemp_directory() { // mkstemp should fail if a directory is given - mkstemp(&env::temp_dir()).expect_err("assertion failed"); + assert!(mkstemp(&env::temp_dir()).is_err()); } #[test] @@ -114,24 +101,20 @@ fn test_mkfifo() { let stats = stat::stat(&mkfifo_fifo).unwrap(); let typ = stat::SFlag::from_bits_truncate(stats.st_mode as mode_t); - assert_eq!(typ, SFlag::S_IFIFO); + assert!(typ == SFlag::S_IFIFO); } #[test] #[cfg(not(target_os = "redox"))] fn test_mkfifo_directory() { // mkfifo should fail if a directory is given - mkfifo(&env::temp_dir(), Mode::S_IRUSR).expect_err("assertion failed"); + assert!(mkfifo(&env::temp_dir(), Mode::S_IRUSR).is_err()); } #[test] #[cfg(not(any( - target_os = "macos", - target_os = "ios", - target_os = "android", - target_os = "redox", - target_os = "haiku" -)))] + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] fn test_mkfifoat_none() { let _m = crate::CWD_LOCK.read(); @@ -147,12 +130,8 @@ fn test_mkfifoat_none() { #[test] #[cfg(not(any( - target_os = "macos", - target_os = "ios", - target_os = "android", - target_os = "redox", - target_os = "haiku" -)))] + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] fn test_mkfifoat() { use nix::fcntl; @@ -162,36 +141,26 @@ fn test_mkfifoat() { mkfifoat(Some(dirfd), mkfifoat_name, Mode::S_IRUSR).unwrap(); - let stats = - stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); + let stats = stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); let typ = stat::SFlag::from_bits_truncate(stats.st_mode); assert_eq!(typ, SFlag::S_IFIFO); } #[test] #[cfg(not(any( - target_os = "macos", - target_os = "ios", - target_os = "android", - target_os = "redox", - target_os = "haiku" -)))] + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] fn test_mkfifoat_directory_none() { let _m = crate::CWD_LOCK.read(); // mkfifoat should fail if a directory is given - mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR) - .expect_err("assertion failed"); + assert!(mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_err()); } #[test] #[cfg(not(any( - target_os = "macos", - target_os = "ios", - target_os = "android", - target_os = "redox", - target_os = "haiku" -)))] + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] fn test_mkfifoat_directory() { // mkfifoat should fail if a directory is given let tempdir = tempdir().unwrap(); @@ -199,8 +168,7 @@ fn test_mkfifoat_directory() { let mkfifoat_dir = "mkfifoat_dir"; stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap(); - mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR) - .expect_err("assertion failed"); + assert!(mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_err()); } #[test] @@ -233,13 +201,7 @@ mod linux_android { #[test] // `getgroups()` and `setgroups()` do not behave as expected on Apple platforms -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "fuchsia")))] fn test_setgroups() { // Skip this test when not run as root as `setgroups()` requires root. skip_if_not_root!("test_setgroups"); @@ -262,14 +224,11 @@ fn test_setgroups() { #[test] // `getgroups()` and `setgroups()` do not behave as expected on Apple platforms -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku", - target_os = "illumos" -)))] +#[cfg(not(any(target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos")))] fn test_initgroups() { // Skip this test when not run as root as `initgroups()` and `setgroups()` // require root. @@ -300,7 +259,7 @@ fn test_initgroups() { } #[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] -macro_rules! execve_test_factory ( +macro_rules! execve_test_factory( ($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => ( #[cfg(test)] @@ -400,7 +359,7 @@ macro_rules! execve_test_factory ( ) ); -cfg_if! { +cfg_if!{ if #[cfg(target_os = "android")] { execve_test_factory!(test_execve, execve, CString::new("/system/bin/sh").unwrap().as_c_str()); execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd()); @@ -425,7 +384,7 @@ cfg_if! { #[cfg(any(target_os = "haiku", target_os = "linux", target_os = "openbsd"))] execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap()); -cfg_if! { +cfg_if!{ if #[cfg(target_os = "android")] { use nix::fcntl::AtFlags; execve_test_factory!(test_execveat_empty, execveat, @@ -458,10 +417,10 @@ fn test_fchdir() { let tmpdir_path = tmpdir.path().canonicalize().unwrap(); let tmpdir_fd = File::open(&tmpdir_path).unwrap().into_raw_fd(); - fchdir(tmpdir_fd).expect("assertion failed"); + assert!(fchdir(tmpdir_fd).is_ok()); assert_eq!(getcwd().unwrap(), tmpdir_path); - close(tmpdir_fd).expect("assertion failed"); + assert!(close(tmpdir_fd).is_ok()); } #[test] @@ -471,7 +430,7 @@ fn test_getcwd() { let tmpdir = tempdir().unwrap(); let tmpdir_path = tmpdir.path().canonicalize().unwrap(); - chdir(&tmpdir_path).expect("assertion failed"); + assert!(chdir(&tmpdir_path).is_ok()); assert_eq!(getcwd().unwrap(), tmpdir_path); // make path 500 chars longer so that buffer doubling in getcwd @@ -482,10 +441,9 @@ fn test_getcwd() { for _ in 0..5 { let newdir = "a".repeat(100); inner_tmp_dir.push(newdir); - mkdir(inner_tmp_dir.as_path(), Mode::S_IRWXU) - .expect("assertion failed"); + assert!(mkdir(inner_tmp_dir.as_path(), Mode::S_IRWXU).is_ok()); } - chdir(inner_tmp_dir.as_path()).expect("assertion failed"); + assert!(chdir(inner_tmp_dir.as_path()).is_ok()); assert_eq!(getcwd().unwrap(), inner_tmp_dir.as_path()); } @@ -540,8 +498,7 @@ fn test_fchownat() { let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); - fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink) - .unwrap(); + fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); chdir(tempdir.path()).unwrap(); fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); @@ -584,7 +541,7 @@ fn test_lseek64() { close(tmpfd).unwrap(); } -cfg_if! { +cfg_if!{ if #[cfg(any(target_os = "android", target_os = "linux"))] { macro_rules! require_acct{ () => { @@ -598,7 +555,7 @@ cfg_if! { skip_if_jailed!("test_acct"); } } - } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "haiku")))] { + } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] { macro_rules! require_acct{ () => { skip_if_not_root!("test_acct"); @@ -608,15 +565,11 @@ cfg_if! { } #[test] -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_acct() { + use tempfile::NamedTempFile; use std::process::Command; use std::{thread, time}; - use tempfile::NamedTempFile; let _m = crate::FORK_MTX.lock(); require_acct!(); @@ -627,11 +580,9 @@ fn test_acct() { acct::enable(path).unwrap(); loop { - Command::new("echo").arg("Hello world").output().unwrap(); + Command::new("echo").arg("Hello world"); let len = fs::metadata(path).unwrap().len(); - if len > 0 { - break; - } + if len > 0 { break; } thread::sleep(time::Duration::from_millis(10)); } acct::disable().unwrap(); @@ -642,36 +593,21 @@ fn test_fpathconf_limited() { let f = tempfile().unwrap(); // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test let path_max = fpathconf(f.as_raw_fd(), PathconfVar::PATH_MAX); - assert!( - path_max - .expect("fpathconf failed") - .expect("PATH_MAX is unlimited") - > 0 - ); + assert!(path_max.expect("fpathconf failed").expect("PATH_MAX is unlimited") > 0); } #[test] fn test_pathconf_limited() { // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test let path_max = pathconf("/", PathconfVar::PATH_MAX); - assert!( - path_max - .expect("pathconf failed") - .expect("PATH_MAX is unlimited") - > 0 - ); + assert!(path_max.expect("pathconf failed").expect("PATH_MAX is unlimited") > 0); } #[test] fn test_sysconf_limited() { // AFAIK, OPEN_MAX is limited on all platforms, so it makes a good test let open_max = sysconf(SysconfVar::OPEN_MAX); - assert!( - open_max - .expect("sysconf failed") - .expect("OPEN_MAX is unlimited") - > 0 - ); + assert!(open_max.expect("sysconf failed").expect("OPEN_MAX is unlimited") > 0); } #[cfg(target_os = "freebsd")] @@ -684,34 +620,31 @@ fn test_sysconf_unsupported() { assert!(open_max.expect("sysconf failed").is_none()) } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] #[test] fn test_getresuid() { let resuids = getresuid().unwrap(); - assert_ne!(resuids.real.as_raw(), libc::uid_t::MAX); - assert_ne!(resuids.effective.as_raw(), libc::uid_t::MAX); - assert_ne!(resuids.saved.as_raw(), libc::uid_t::MAX); + assert!(resuids.real.as_raw() != libc::uid_t::max_value()); + assert!(resuids.effective.as_raw() != libc::uid_t::max_value()); + assert!(resuids.saved.as_raw() != libc::uid_t::max_value()); } -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "linux", - target_os = "openbsd" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] #[test] fn test_getresgid() { let resgids = getresgid().unwrap(); - assert_ne!(resgids.real.as_raw(), libc::gid_t::MAX); - assert_ne!(resgids.effective.as_raw(), libc::gid_t::MAX); - assert_ne!(resgids.saved.as_raw(), libc::gid_t::MAX); + assert!(resgids.real.as_raw() != libc::gid_t::max_value()); + assert!(resgids.effective.as_raw() != libc::gid_t::max_value()); + assert!(resgids.saved.as_raw() != libc::gid_t::max_value()); } // Test that we can create a pair of pipes. No need to verify that they pass @@ -719,31 +652,25 @@ fn test_getresgid() { #[test] fn test_pipe() { let (fd0, fd1) = pipe().unwrap(); - let m0 = stat::SFlag::from_bits_truncate( - stat::fstat(fd0).unwrap().st_mode as mode_t, - ); + let m0 = stat::SFlag::from_bits_truncate(stat::fstat(fd0).unwrap().st_mode as mode_t); // S_IFIFO means it's a pipe assert_eq!(m0, SFlag::S_IFIFO); - let m1 = stat::SFlag::from_bits_truncate( - stat::fstat(fd1).unwrap().st_mode as mode_t, - ); + let m1 = stat::SFlag::from_bits_truncate(stat::fstat(fd1).unwrap().st_mode as mode_t); assert_eq!(m1, SFlag::S_IFIFO); } // pipe2(2) is the same as pipe(2), except it allows setting some flags. Check // that we can set a flag. -#[cfg(any( - target_os = "android", - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "illumos", - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris" -))] +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris"))] #[test] fn test_pipe2() { use nix::fcntl::{fcntl, FcntlArg, FdFlag}; @@ -798,13 +725,8 @@ static mut ALARM_CALLED: bool = false; // Used in `test_alarm`. #[cfg(not(target_os = "redox"))] -pub extern "C" fn alarm_signal_handler(raw_signal: libc::c_int) { - assert_eq!( - raw_signal, - libc::SIGALRM, - "unexpected signal: {}", - raw_signal - ); +pub extern fn alarm_signal_handler(raw_signal: libc::c_int) { + assert_eq!(raw_signal, libc::SIGALRM, "unexpected signal: {}", raw_signal); unsafe { ALARM_CALLED = true }; } @@ -812,16 +734,15 @@ pub extern "C" fn alarm_signal_handler(raw_signal: libc::c_int) { #[cfg(not(target_os = "redox"))] fn test_alarm() { use std::{ - thread, - time::{Duration, Instant}, + time::{Duration, Instant,}, + thread }; // Maybe other tests that fork interfere with this one? let _m = crate::SIGNAL_MTX.lock(); let handler = SigHandler::Handler(alarm_signal_handler); - let signal_action = - SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let signal_action = SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); let old_handler = unsafe { sigaction(Signal::SIGALRM, &signal_action) .expect("unable to set signal handler for alarm") @@ -838,7 +759,7 @@ fn test_alarm() { let starttime = Instant::now(); loop { thread::sleep(Duration::from_millis(100)); - if unsafe { ALARM_CALLED } { + if unsafe { ALARM_CALLED} { break; } if starttime.elapsed() > Duration::from_secs(3) { @@ -865,7 +786,7 @@ fn test_canceling_alarm() { } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_symlinkat() { let _m = crate::CWD_LOCK.read(); @@ -893,7 +814,7 @@ fn test_symlinkat() { } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_linkat_file() { let tempdir = tempdir().unwrap(); let oldfilename = "foo.txt"; @@ -906,24 +827,15 @@ fn test_linkat_file() { File::create(&oldfilepath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt hard link file at relative path - linkat( - Some(dirfd), - oldfilename, - Some(dirfd), - newfilename, - LinkatFlags::SymlinkFollow, - ) - .unwrap(); + linkat(Some(dirfd), oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); assert!(newfilepath.exists()); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_linkat_olddirfd_none() { let _dr = crate::DirRestore::new(); @@ -939,28 +851,16 @@ fn test_linkat_olddirfd_none() { File::create(&oldfilepath).unwrap(); // Get file descriptor for base directory of new file - let dirfd = fcntl::open( - tempdir_newfile.path(), - fcntl::OFlag::empty(), - stat::Mode::empty(), - ) - .unwrap(); + let dirfd = fcntl::open(tempdir_newfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt hard link file using curent working directory as relative path for old file path chdir(tempdir_oldfile.path()).unwrap(); - linkat( - None, - oldfilename, - Some(dirfd), - newfilename, - LinkatFlags::SymlinkFollow, - ) - .unwrap(); + linkat(None, oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); assert!(newfilepath.exists()); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_linkat_newdirfd_none() { let _dr = crate::DirRestore::new(); @@ -976,33 +876,16 @@ fn test_linkat_newdirfd_none() { File::create(&oldfilepath).unwrap(); // Get file descriptor for base directory of old file - let dirfd = fcntl::open( - tempdir_oldfile.path(), - fcntl::OFlag::empty(), - stat::Mode::empty(), - ) - .unwrap(); + let dirfd = fcntl::open(tempdir_oldfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt hard link file using current working directory as relative path for new file path chdir(tempdir_newfile.path()).unwrap(); - linkat( - Some(dirfd), - oldfilename, - None, - newfilename, - LinkatFlags::SymlinkFollow, - ) - .unwrap(); + linkat(Some(dirfd), oldfilename, None, newfilename, LinkatFlags::SymlinkFollow).unwrap(); assert!(newfilepath.exists()); } #[test] -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] fn test_linkat_no_follow_symlink() { let _m = crate::CWD_LOCK.read(); @@ -1023,29 +906,23 @@ fn test_linkat_no_follow_symlink() { symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt link symlink of file at relative path - linkat( - Some(dirfd), - symoldfilename, - Some(dirfd), - newfilename, - LinkatFlags::NoSymlinkFollow, - ) - .unwrap(); + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::NoSymlinkFollow).unwrap(); // Assert newfile is actually a symlink to oldfile. assert_eq!( - readlink(&newfilepath).unwrap().to_str().unwrap(), + readlink(&newfilepath) + .unwrap() + .to_str() + .unwrap(), oldfilepath.to_str().unwrap() ); } #[test] -#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg(not(target_os = "redox"))] fn test_linkat_follow_symlink() { let _m = crate::CWD_LOCK.read(); @@ -1066,26 +943,15 @@ fn test_linkat_follow_symlink() { symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt link target of symlink of file at relative path - linkat( - Some(dirfd), - symoldfilename, - Some(dirfd), - newfilename, - LinkatFlags::SymlinkFollow, - ) - .unwrap(); + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); let newfilestat = stat::stat(&newfilepath).unwrap(); // Check the file type of the new link - assert_eq!( - (stat::SFlag::from_bits_truncate(newfilestat.st_mode as mode_t) - & SFlag::S_IFMT), + assert_eq!((stat::SFlag::from_bits_truncate(newfilestat.st_mode as mode_t) & SFlag::S_IFMT), SFlag::S_IFREG ); @@ -1104,15 +970,12 @@ fn test_unlinkat_dir_noremovedir() { DirBuilder::new().recursive(true).create(&dirpath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt unlink dir at relative path without proper flag - let err_result = - unlinkat(Some(dirfd), dirname, UnlinkatFlags::NoRemoveDir).unwrap_err(); + let err_result = unlinkat(Some(dirfd), dirname, UnlinkatFlags::NoRemoveDir).unwrap_err(); assert!(err_result == Errno::EISDIR || err_result == Errno::EPERM); -} + } #[test] #[cfg(not(target_os = "redox"))] @@ -1125,14 +988,12 @@ fn test_unlinkat_dir_removedir() { DirBuilder::new().recursive(true).create(&dirpath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt unlink dir at relative path with proper flag unlinkat(Some(dirfd), dirname, UnlinkatFlags::RemoveDir).unwrap(); assert!(!dirpath.exists()); -} + } #[test] #[cfg(not(target_os = "redox"))] @@ -1145,47 +1006,34 @@ fn test_unlinkat_file() { File::create(&filepath).unwrap(); // Get file descriptor for base directory - let dirfd = - fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) - .unwrap(); + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); // Attempt unlink file at relative path unlinkat(Some(dirfd), filename, UnlinkatFlags::NoRemoveDir).unwrap(); assert!(!filepath.exists()); -} + } #[test] fn test_access_not_existing() { let tempdir = tempdir().unwrap(); let dir = tempdir.path().join("does_not_exist.txt"); - assert_eq!( - access(&dir, AccessFlags::F_OK).err().unwrap(), - Errno::ENOENT - ); + assert_eq!(access(&dir, AccessFlags::F_OK).err().unwrap(), + Errno::ENOENT); } #[test] fn test_access_file_exists() { let tempdir = tempdir().unwrap(); - let path = tempdir.path().join("does_exist.txt"); + let path = tempdir.path().join("does_exist.txt"); let _file = File::create(path.clone()).unwrap(); - access(&path, AccessFlags::R_OK | AccessFlags::W_OK) - .expect("assertion failed"); + assert!(access(&path, AccessFlags::R_OK | AccessFlags::W_OK).is_ok()); } -//Clippy false positive https://github.com/rust-lang/rust-clippy/issues/9111 -#[allow(clippy::needless_borrow)] #[cfg(not(target_os = "redox"))] #[test] fn test_user_into_passwd() { // get the UID of the "nobody" user - #[cfg(not(target_os = "haiku"))] - let test_username = "nobody"; - // "nobody" unavailable on haiku - #[cfg(target_os = "haiku")] - let test_username = "user"; - - let nobody = User::from_name(test_username).unwrap().unwrap(); + let nobody = User::from_name("nobody").unwrap().unwrap(); let pwd: libc::passwd = nobody.into(); let _: User = (&pwd).into(); } @@ -1204,7 +1052,8 @@ fn test_setfsuid() { // create a temporary file with permissions '-rw-r-----' let file = tempfile::NamedTempFile::new_in("/var/tmp").unwrap(); let temp_path = file.into_temp_path(); - let temp_path_2 = temp_path.to_path_buf(); + dbg!(&temp_path); + let temp_path_2 = (&temp_path).to_path_buf(); let mut permissions = fs::metadata(&temp_path).unwrap().permissions(); permissions.set_mode(0o640); @@ -1214,8 +1063,8 @@ fn test_setfsuid() { let fuid = setfsuid(nobody.uid); // trying to open the temporary file should fail with EACCES let res = fs::File::open(&temp_path); - let err = res.expect_err("assertion failed"); - assert_eq!(err.kind(), io::ErrorKind::PermissionDenied); + assert!(res.is_err()); + assert_eq!(res.err().unwrap().kind(), io::ErrorKind::PermissionDenied); // assert fuid actually changes let prev_fuid = setfsuid(Uid::from_raw(-1i32 as u32)); @@ -1229,11 +1078,7 @@ fn test_setfsuid() { } #[test] -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_ttyname() { let fd = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); assert!(fd.as_raw_fd() > 0); @@ -1244,8 +1089,11 @@ fn test_ttyname() { grantpt(&fd).expect("grantpt failed"); unlockpt(&fd).expect("unlockpt failed"); let sname = unsafe { ptsname(&fd) }.expect("ptsname failed"); - let fds = open(Path::new(&sname), OFlag::O_RDWR, stat::Mode::empty()) - .expect("open failed"); + let fds = open( + Path::new(&sname), + OFlag::O_RDWR, + stat::Mode::empty(), + ).expect("open failed"); assert!(fds > 0); let name = ttyname(fds).expect("ttyname failed"); @@ -1261,11 +1109,7 @@ fn test_ttyname_not_pty() { } #[test] -#[cfg(not(any( - target_os = "redox", - target_os = "fuchsia", - target_os = "haiku" -)))] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] fn test_ttyname_invalid_fd() { assert_eq!(ttyname(-1), Err(Errno::EBADF)); } @@ -1306,73 +1150,5 @@ fn test_getpeereid() { ))] fn test_getpeereid_invalid_fd() { // getpeereid is not POSIX, so error codes are inconsistent between different Unices. - getpeereid(-1).expect_err("assertion failed"); -} - -#[test] -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] -fn test_faccessat_none_not_existing() { - use nix::fcntl::AtFlags; - let tempdir = tempfile::tempdir().unwrap(); - let dir = tempdir.path().join("does_not_exist.txt"); - assert_eq!( - faccessat(None, &dir, AccessFlags::F_OK, AtFlags::empty()) - .err() - .unwrap(), - Errno::ENOENT - ); -} - -#[test] -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] -fn test_faccessat_not_existing() { - use nix::fcntl::AtFlags; - let tempdir = tempfile::tempdir().unwrap(); - let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); - let not_exist_file = "does_not_exist.txt"; - assert_eq!( - faccessat( - Some(dirfd), - not_exist_file, - AccessFlags::F_OK, - AtFlags::empty(), - ) - .err() - .unwrap(), - Errno::ENOENT - ); -} - -#[test] -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] -fn test_faccessat_none_file_exists() { - use nix::fcntl::AtFlags; - let tempdir = tempfile::tempdir().unwrap(); - let path = tempdir.path().join("does_exist.txt"); - let _file = File::create(path.clone()).unwrap(); - assert!(faccessat( - None, - &path, - AccessFlags::R_OK | AccessFlags::W_OK, - AtFlags::empty(), - ) - .is_ok()); -} - -#[test] -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] -fn test_faccessat_file_exists() { - use nix::fcntl::AtFlags; - let tempdir = tempfile::tempdir().unwrap(); - let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); - let exist_file = "does_exist.txt"; - let path = tempdir.path().join(exist_file); - let _file = File::create(path.clone()).unwrap(); - assert!(faccessat( - Some(dirfd), - &path, - AccessFlags::R_OK | AccessFlags::W_OK, - AtFlags::empty(), - ) - .is_ok()); + assert!(getpeereid(-1).is_err()); } diff --git a/bash-5.1/vendor/once_cell/.cargo-checksum.json b/bash-5.1/vendor/once_cell/.cargo-checksum.json index 6f8adad723741cc711f94a6c2c9d6bd71da377d2..9dffae3ad27b85b8ee5e807734efe0b2ee7ce79c 100644 --- a/bash-5.1/vendor/once_cell/.cargo-checksum.json +++ b/bash-5.1/vendor/once_cell/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"f6198c1a83a8245a7b2ab062a316f3f97dfba190ac1d6bb47949e9c0cf4dac80","Cargo.lock":"e69c2663fe7efb3a4e463af446fa1367bd8e008100500137052ef15b84b02ebc","Cargo.toml":"d08e0411e5eda265a3359939f1fb646dff29ca38896222ffe0900b0af8e3ae70","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"813d262a320611ba874c4b2488256bdb2b4073649616a1471b389d464a704301","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"8bca1b264da21eceb1ccaf30477fc941bc71bedd030f1c6982ed3a7804abfb4f","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"1959494004fb0ee7443e97c4abd8be69d7173fe2b66f8fff0bca7b5c8e512525","src/imp_std.rs":"33be3a0df87e092abd68280dc72d50534d273d17eb86940e7ba2b8a45da78a70","src/lib.rs":"88d2f7a63bd63f630733c86ea035b53e53f2f8d3c44f1025bc9bbe5ceaa7375f","src/race.rs":"5a19afca4b5510d09ca7317b96f5642725c58b0969b2bdeb7275ed674d061e5d","tests/it.rs":"4448a74a9898babfb943bae42ebfe3b07ec2b002ea39712127159955015d33b4"},"package":"e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"} \ No newline at end of file +{"files":{"CHANGELOG.md":"1638f5757551c399130656e1daab76b0322538923a791bf39e9ec247257daf79","Cargo.lock":"417a830ee5d5359f413fdf973391bf137de7ea8b075d83dcf798f1d3de36cfda","Cargo.toml":"d083a23d498e2dbf1cb3f249bdade38715b3cb237a38b733df79f20824eec4f7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"813d262a320611ba874c4b2488256bdb2b4073649616a1471b389d464a704301","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"1959494004fb0ee7443e97c4abd8be69d7173fe2b66f8fff0bca7b5c8e512525","src/imp_std.rs":"33be3a0df87e092abd68280dc72d50534d273d17eb86940e7ba2b8a45da78a70","src/lib.rs":"5320847175dc279e7abd2d98e17ab8d05b2eb7e383a4f249623b71a5209f2346","src/race.rs":"5a19afca4b5510d09ca7317b96f5642725c58b0969b2bdeb7275ed674d061e5d","tests/it.rs":"501c4ab3f4e718fa555707e9d32f3688c05e4ef8ea967e72e1c99da6bb06a0ad"},"package":"074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"} \ No newline at end of file diff --git a/bash-5.1/vendor/once_cell/CHANGELOG.md b/bash-5.1/vendor/once_cell/CHANGELOG.md index 005ce69519c4b7c2674d999d72f7e7cabec8e79d..ffb5b1df3c1f09bc41fd8c99735645dbf727138b 100644 --- a/bash-5.1/vendor/once_cell/CHANGELOG.md +++ b/bash-5.1/vendor/once_cell/CHANGELOG.md @@ -4,18 +4,6 @@ - -## 1.15.0 - -- Increase minimal supported Rust version to 1.56.0. -- Implement `UnwindSafe` even if the `std` feature is disabled. - -## 1.14.0 - -- Add extension to `unsync` and `sync` `Lazy` mut API: - - `force_mut` - - `get_mut` - - ## 1.13.1 - Make implementation compliant with [strict provenance](https://github.com/rust-lang/rust/issues/95228). diff --git a/bash-5.1/vendor/once_cell/Cargo.toml b/bash-5.1/vendor/once_cell/Cargo.toml index bde77ee9d30d38ead895560456a8f6cd5d789a2d..e8222f1639ab5dbb146178328b9b98424f984a86 100644 --- a/bash-5.1/vendor/once_cell/Cargo.toml +++ b/bash-5.1/vendor/once_cell/Cargo.toml @@ -10,10 +10,9 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2021" -rust-version = "1.56" +edition = "2018" name = "once_cell" -version = "1.15.0" +version = "1.13.1" authors = ["Aleksey Kladov "] exclude = [ "*.png", @@ -34,7 +33,6 @@ categories = [ ] license = "MIT OR Apache-2.0" repository = "https://github.com/matklad/once_cell" -resolver = "2" [package.metadata.docs.rs] all-features = true diff --git a/bash-5.1/vendor/once_cell/examples/lazy_static.rs b/bash-5.1/vendor/once_cell/examples/lazy_static.rs index 3cdb19f2a5d34f5de6155e01c890d4cc94d65937..f0505609b0e8fc303024913b2cbe271ccc82c8da 100644 --- a/bash-5.1/vendor/once_cell/examples/lazy_static.rs +++ b/bash-5.1/vendor/once_cell/examples/lazy_static.rs @@ -32,5 +32,5 @@ fn main() { // The same works for function-style: assert_eq!(hashmap().get(&0), Some(&"foo")); - assert_eq!(hashmap().get(&1), Some(&"bar")); + assert_eq!(hashmap().get(&0), Some(&"bar")); } diff --git a/bash-5.1/vendor/once_cell/src/lib.rs b/bash-5.1/vendor/once_cell/src/lib.rs index 6de1e3eebdcd7f86fec7534bf478f572e7613982..70f08dea601240668f4cf28aba655313e245f1c2 100644 --- a/bash-5.1/vendor/once_cell/src/lib.rs +++ b/bash-5.1/vendor/once_cell/src/lib.rs @@ -267,7 +267,7 @@ //! //! # Minimum Supported `rustc` Version //! -//! This crate's minimum supported `rustc` version is `1.56.0`. +//! This crate's minimum supported `rustc` version is `1.36.0`. //! //! If only the `std` feature is enabled, MSRV will be updated conservatively. //! When using other features, like `parking_lot`, MSRV might be updated more frequently, up to the latest stable. @@ -348,9 +348,11 @@ pub mod unsync { cell::{Cell, UnsafeCell}, fmt, hint, mem, ops::{Deref, DerefMut}, - panic::{RefUnwindSafe, UnwindSafe}, }; + #[cfg(feature = "std")] + use std::panic::{RefUnwindSafe, UnwindSafe}; + /// A cell which can be written to only once. It is not thread safe. /// /// Unlike [`std::cell::RefCell`], a `OnceCell` provides simple `&` @@ -380,7 +382,9 @@ pub mod unsync { // `&unsync::OnceCell` to sneak a `T` through `catch_unwind`, // by initializing the cell in closure and extracting the value in the // `Drop`. + #[cfg(feature = "std")] impl RefUnwindSafe for OnceCell {} + #[cfg(feature = "std")] impl UnwindSafe for OnceCell {} impl Default for OnceCell { @@ -676,6 +680,7 @@ pub mod unsync { init: Cell>, } + #[cfg(feature = "std")] impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} impl fmt::Debug for Lazy { @@ -737,25 +742,6 @@ pub mod unsync { }) } - /// Forces the evaluation of this lazy value and returns a mutable reference to - /// the result. - /// - /// This is equivalent to the `DerefMut` impl, but is explicit. - /// - /// # Example - /// ``` - /// use once_cell::unsync::Lazy; - /// - /// let mut lazy = Lazy::new(|| 92); - /// - /// assert_eq!(Lazy::force_mut(&mut lazy), &92); - /// assert_eq!(*lazy, 92); - /// ``` - pub fn force_mut(this: &mut Lazy) -> &mut T { - Self::force(this); - Self::get_mut(this).unwrap_or_else(|| unreachable!()) - } - /// Gets the reference to the result of this lazy value if /// it was initialized, otherwise returns `None`. /// @@ -772,23 +758,6 @@ pub mod unsync { pub fn get(this: &Lazy) -> Option<&T> { this.cell.get() } - - /// Gets the mutable reference to the result of this lazy value if - /// it was initialized, otherwise returns `None`. - /// - /// # Example - /// ``` - /// use once_cell::unsync::Lazy; - /// - /// let mut lazy = Lazy::new(|| 92); - /// - /// assert_eq!(Lazy::get_mut(&mut lazy), None); - /// assert_eq!(*lazy, 92); - /// assert_eq!(Lazy::get_mut(&mut lazy), Some(&mut 92)); - /// ``` - pub fn get_mut(this: &mut Lazy) -> Option<&mut T> { - this.cell.get_mut() - } } impl T> Deref for Lazy { @@ -1220,6 +1189,7 @@ pub mod sync { unsafe impl Sync for Lazy where OnceCell: Sync {} // auto-derived `Send` impl is OK. + #[cfg(feature = "std")] impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} impl Lazy { @@ -1262,23 +1232,6 @@ pub mod sync { }) } - /// Forces the evaluation of this lazy value and - /// returns a mutable reference to the result. This is equivalent - /// to the `Deref` impl, but is explicit. - /// - /// # Example - /// ``` - /// use once_cell::sync::Lazy; - /// - /// let mut lazy = Lazy::new(|| 92); - /// - /// assert_eq!(Lazy::force_mut(&mut lazy), &mut 92); - /// ``` - pub fn force_mut(this: &mut Lazy) -> &mut T { - Self::force(this); - Self::get_mut(this).unwrap_or_else(|| unreachable!()) - } - /// Gets the reference to the result of this lazy value if /// it was initialized, otherwise returns `None`. /// @@ -1295,23 +1248,6 @@ pub mod sync { pub fn get(this: &Lazy) -> Option<&T> { this.cell.get() } - - /// Gets the reference to the result of this lazy value if - /// it was initialized, otherwise returns `None`. - /// - /// # Example - /// ``` - /// use once_cell::sync::Lazy; - /// - /// let mut lazy = Lazy::new(|| 92); - /// - /// assert_eq!(Lazy::get_mut(&mut lazy), None); - /// assert_eq!(&*lazy, &92); - /// assert_eq!(Lazy::get_mut(&mut lazy), Some(&mut 92)); - /// ``` - pub fn get_mut(this: &mut Lazy) -> Option<&mut T> { - this.cell.get_mut() - } } impl T> Deref for Lazy { diff --git a/bash-5.1/vendor/once_cell/tests/it.rs b/bash-5.1/vendor/once_cell/tests/it.rs index 410b93b6490ff3465a65cd72d05d48018b1882e8..476f14bb099bfbae9a8a37732aa100803493d7bf 100644 --- a/bash-5.1/vendor/once_cell/tests/it.rs +++ b/bash-5.1/vendor/once_cell/tests/it.rs @@ -137,41 +137,6 @@ mod unsync { assert_eq!(called.get(), 1); } - #[test] - fn lazy_force_mut() { - let called = Cell::new(0); - let mut x = Lazy::new(|| { - called.set(called.get() + 1); - 92 - }); - assert_eq!(called.get(), 0); - let v = Lazy::force_mut(&mut x); - assert_eq!(called.get(), 1); - - *v /= 2; - assert_eq!(*x, 46); - assert_eq!(called.get(), 1); - } - - #[test] - fn lazy_get_mut() { - let called = Cell::new(0); - let mut x: Lazy = Lazy::new(|| { - called.set(called.get() + 1); - 92 - }); - - assert_eq!(called.get(), 0); - assert_eq!(*x, 92); - - let mut_ref: &mut u32 = Lazy::get_mut(&mut x).unwrap(); - assert_eq!(called.get(), 1); - - *mut_ref /= 2; - assert_eq!(*x, 46); - assert_eq!(called.get(), 1); - } - #[test] fn lazy_default() { static CALLED: AtomicUsize = AtomicUsize::new(0); diff --git a/bash-5.1/vendor/proc-macro2/.cargo-checksum.json b/bash-5.1/vendor/proc-macro2/.cargo-checksum.json index 8d2317fedfcada3ab7438976870eb5a489617d3a..59f2a848380301ed3c77e87688a400c3cf2cdbf6 100644 --- a/bash-5.1/vendor/proc-macro2/.cargo-checksum.json +++ b/bash-5.1/vendor/proc-macro2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"9505cf076f910ef2f0b0ceb4a90c02bb42bcb9447996c4938a02f5fc3c4afe7a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"0c17148c1957c3f721d99fc99aedaefee5f2f1ba7e2336a289b02f91609099fb","build.rs":"275f7a9ee0b9eff972124951de544ae17ee3e698a4e89b0f0393b334344f5e30","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/fallback.rs":"a9e6fa159d6a111a231fa9367d54859103e9d49f6662397baea951b5f3e7e983","src/lib.rs":"a2fa0948c2475b762b293be6d1fbbe2ea6b1801f13cd1628e8ac71044c331641","src/marker.rs":"344a8394f06a1d43355b514920e7e3c0c6dce507be767e3a590bbe3552edd110","src/parse.rs":"ac37962914e575cd8f4537f9edf484d8a7ebbc3fd8c80bb7107ff8200d17be60","src/rcvec.rs":"49b6784c6ca5f32573cd8a83758b485d8acbfa126e5fb516ae439e429ef4c144","src/wrapper.rs":"8ea825cdac628570719a258419fcffd1c9d2ca1ca5e2fbbbf283dd9cc6695910","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"cb6d776eba6a238d726b0f531883adf41957e06f2717ee8a069821c81e7081d6","tests/test.rs":"d7f21088314d1df25447fdc0a32feffae26d4d637e3ce68e23c0190060cb5652","tests/test_fmt.rs":"9357769945784354909259084ec8b34d2aa52081dd3967cac6dae3a5e3df3bc0"},"package":"94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"} \ No newline at end of file +{"files":{"Cargo.toml":"774906eb037620dba1ef4cf6adc14ec35e7f9f81d1e2d967dfedfab8e7b603d9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"0c17148c1957c3f721d99fc99aedaefee5f2f1ba7e2336a289b02f91609099fb","build.rs":"2c6ddbeeb1700b8dba3689185a535c672dc43e9d61b54f835cf4f3cc163b4afc","src/detection.rs":"ed9a5f9a979ab01247d7a68eeb1afa3c13209334c5bfff0f9289cb07e5bb4e8b","src/fallback.rs":"5aab7b73e381dc192256a0c67c99706ae0850159fd9f805fb0c9418fc14b1e00","src/lib.rs":"8bd3da5c9f048acda3799d53eefb7fb2f8b4046612d48f34ec30102b10f4ab08","src/marker.rs":"344a8394f06a1d43355b514920e7e3c0c6dce507be767e3a590bbe3552edd110","src/parse.rs":"34fa3c2e03fa9ab3e63ea57595d1dea4edf0fcfa313a04057e4dd7dc7d7269e0","src/rcvec.rs":"49b6784c6ca5f32573cd8a83758b485d8acbfa126e5fb516ae439e429ef4c144","src/wrapper.rs":"a88d0dff9bb8317071ec205b0c2a79717cd8313041e03ef58e0645be65ab05e8","tests/comments.rs":"31115b3a56c83d93eef2fb4c9566bf4543e302560732986161b98aef504785ed","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"cb6d776eba6a238d726b0f531883adf41957e06f2717ee8a069821c81e7081d6","tests/test.rs":"2fe87d2eab135fb2417cac2876998e9314616fb68981918d7d76333c22b199a0","tests/test_fmt.rs":"9357769945784354909259084ec8b34d2aa52081dd3967cac6dae3a5e3df3bc0"},"package":"0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"} \ No newline at end of file diff --git a/bash-5.1/vendor/proc-macro2/Cargo.toml b/bash-5.1/vendor/proc-macro2/Cargo.toml index 531faf22d2f3c167845542547fbac5910c9d4743..b8b46430dc49d57267386c984c517a6e27cf3305 100644 --- a/bash-5.1/vendor/proc-macro2/Cargo.toml +++ b/bash-5.1/vendor/proc-macro2/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "proc-macro2" -version = "1.0.46" +version = "1.0.43" authors = [ "David Tolnay ", "Alex Crichton ", diff --git a/bash-5.1/vendor/proc-macro2/build.rs b/bash-5.1/vendor/proc-macro2/build.rs index b69d813f0427e1e21b1f71e441d3e209d38dbb12..38404967dcbd84f8d906b03554da0b958e9414a5 100644 --- a/bash-5.1/vendor/proc-macro2/build.rs +++ b/bash-5.1/vendor/proc-macro2/build.rs @@ -111,10 +111,7 @@ fn main() { println!("cargo:rustc-cfg=wrap_proc_macro"); } - if version.nightly - && feature_allowed("proc_macro_span") - && feature_allowed("proc_macro_span_shrink") - { + if version.nightly && feature_allowed("proc_macro_span") { println!("cargo:rustc-cfg=proc_macro_span"); } diff --git a/bash-5.1/vendor/proc-macro2/src/fallback.rs b/bash-5.1/vendor/proc-macro2/src/fallback.rs index fe4f248d3d21ad99903cbc9c55f1481feb4f706e..378ef7e94a9cf1bbe20107535a0225da781ccd5b 100644 --- a/bash-5.1/vendor/proc-macro2/src/fallback.rs +++ b/bash-5.1/vendor/proc-macro2/src/fallback.rs @@ -182,13 +182,7 @@ impl FromStr for TokenStream { fn from_str(src: &str) -> Result { // Create a dummy file & add it to the source map - let mut cursor = get_cursor(src); - - // Strip a byte order mark if present - const BYTE_ORDER_MARK: &str = "\u{feff}"; - if cursor.starts_with(BYTE_ORDER_MARK) { - cursor = cursor.advance(BYTE_ORDER_MARK.len()); - } + let cursor = get_cursor(src); parse::token_stream(cursor) } @@ -518,26 +512,6 @@ impl Span { }) } - #[cfg(procmacro2_semver_exempt)] - pub fn before(&self) -> Span { - Span { - #[cfg(span_locations)] - lo: self.lo, - #[cfg(span_locations)] - hi: self.lo, - } - } - - #[cfg(procmacro2_semver_exempt)] - pub fn after(&self) -> Span { - Span { - #[cfg(span_locations)] - lo: self.hi, - #[cfg(span_locations)] - hi: self.hi, - } - } - #[cfg(not(span_locations))] pub fn join(&self, _other: Span) -> Option { Some(Span {}) diff --git a/bash-5.1/vendor/proc-macro2/src/lib.rs b/bash-5.1/vendor/proc-macro2/src/lib.rs index 47b48df222722d2adf94e55617dc44a18e76683d..be5aa51147246ec93b69e1021069890b5977f2e9 100644 --- a/bash-5.1/vendor/proc-macro2/src/lib.rs +++ b/bash-5.1/vendor/proc-macro2/src/lib.rs @@ -86,11 +86,8 @@ //! a different thread. // Proc-macro2 types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.46")] -#![cfg_attr( - any(proc_macro_span, super_unstable), - feature(proc_macro_span, proc_macro_span_shrink) -)] +#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.43")] +#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] #![cfg_attr(super_unstable, feature(proc_macro_def_site))] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow( @@ -512,24 +509,6 @@ impl Span { LineColumn { line, column } } - /// Creates an empty span pointing to directly before this span. - /// - /// This method is semver exempt and not exposed by default. - #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] - #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] - pub fn before(&self) -> Span { - Span::_new(self.inner.before()) - } - - /// Creates an empty span pointing to directly after this span. - /// - /// This method is semver exempt and not exposed by default. - #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] - #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))] - pub fn after(&self) -> Span { - Span::_new(self.inner.after()) - } - /// Create a new span encompassing `self` and `other`. /// /// Returns `None` if `self` and `other` are from different files. diff --git a/bash-5.1/vendor/proc-macro2/src/parse.rs b/bash-5.1/vendor/proc-macro2/src/parse.rs index 04c4833694dc9bfdcc77aaceb235a230491d6b6d..1c9974cfa5b20623254344194268c6b728fdb2a3 100644 --- a/bash-5.1/vendor/proc-macro2/src/parse.rs +++ b/bash-5.1/vendor/proc-macro2/src/parse.rs @@ -14,7 +14,7 @@ pub(crate) struct Cursor<'a> { } impl<'a> Cursor<'a> { - pub fn advance(&self, bytes: usize) -> Cursor<'a> { + fn advance(&self, bytes: usize) -> Cursor<'a> { let (_front, rest) = self.rest.split_at(bytes); Cursor { rest, @@ -23,7 +23,7 @@ impl<'a> Cursor<'a> { } } - pub fn starts_with(&self, s: &str) -> bool { + fn starts_with(&self, s: &str) -> bool { self.rest.starts_with(s) } @@ -283,9 +283,8 @@ fn ident_any(input: Cursor) -> PResult { return Ok((rest, ident)); } - match sym { - "_" | "super" | "self" | "Self" | "crate" => return Err(Reject), - _ => {} + if sym == "_" { + return Err(Reject); } let ident = crate::Ident::_new_raw(sym, crate::Span::call_site()); diff --git a/bash-5.1/vendor/proc-macro2/src/wrapper.rs b/bash-5.1/vendor/proc-macro2/src/wrapper.rs index 47d14947324478baaf3c97ba9f6d698b58925d41..934440139843e02c2dd85cc315644a018809f4bf 100644 --- a/bash-5.1/vendor/proc-macro2/src/wrapper.rs +++ b/bash-5.1/vendor/proc-macro2/src/wrapper.rs @@ -505,22 +505,6 @@ impl Span { } } - #[cfg(super_unstable)] - pub fn before(&self) -> Span { - match self { - Span::Compiler(s) => Span::Compiler(s.before()), - Span::Fallback(s) => Span::Fallback(s.before()), - } - } - - #[cfg(super_unstable)] - pub fn after(&self) -> Span { - match self { - Span::Compiler(s) => Span::Compiler(s.after()), - Span::Fallback(s) => Span::Fallback(s.after()), - } - } - pub fn join(&self, other: Span) -> Option { let ret = match (self, other) { #[cfg(proc_macro_span)] diff --git a/bash-5.1/vendor/proc-macro2/tests/test.rs b/bash-5.1/vendor/proc-macro2/tests/test.rs index 8f5624dbc29137b1cfea90a1bf4236ea0bd014cb..16f775ed0f30b1c69813a9a76e1cedad79c91fd5 100644 --- a/bash-5.1/vendor/proc-macro2/tests/test.rs +++ b/bash-5.1/vendor/proc-macro2/tests/test.rs @@ -630,16 +630,3 @@ fn check_spans_internal(ts: TokenStream, lines: &mut &[(usize, usize, usize, usi } } } - -#[test] -fn byte_order_mark() { - let string = "\u{feff}foo"; - let tokens = string.parse::().unwrap(); - match tokens.into_iter().next().unwrap() { - TokenTree::Ident(ident) => assert_eq!(ident, "foo"), - _ => unreachable!(), - } - - let string = "foo\u{feff}"; - string.parse::().unwrap_err(); -} diff --git a/bash-5.1/vendor/smallvec/.cargo-checksum.json b/bash-5.1/vendor/smallvec/.cargo-checksum.json index e9fa9e1e6044c379d6bcd834ad32d1235557a197..8f4d7bf91387cd96323aa2d16f8f9e74215ac7d5 100644 --- a/bash-5.1/vendor/smallvec/.cargo-checksum.json +++ b/bash-5.1/vendor/smallvec/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"e8b7e22c87fa34e053c12b3751ec0c7b25b37bd1285959710321a7a00861f392","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"e2a235d68be20996014c00468b369887d2041ce95486625de3cef35b8f2e4acd","debug_metadata/README.md":"dc8fbf896055359a94f7bfdfae7604e0bcfc8b10998a218d484d9fffdf83637c","debug_metadata/smallvec.natvis":"68aed2322bdc13ed6fa2021dc9625346174d73590929acbc2f95c98785c8dee4","scripts/run_miri.sh":"74a9f9adc43f986e81977b03846f7dd00122a0150bd8ec3fe4842a1a787e0f07","src/arbitrary.rs":"22e55cfbf60374945b30e6d0855129eff67cd8b878cef6fa997e1f4be67b9e3d","src/lib.rs":"35c60a9d9240853e9f6f84b7a44ff6a3197a87ab404f5ab1cd8ebeeeb72e54da","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"2bcf69dc0597e4e8a59a92566a3dd5c82ec3a1ea563aa006ea0f4a2722cb2d17","tests/debugger_visualizer.rs":"87480900add8579e1285741d5a0041063b6d888328e11854ab2cdc2960d7ddb1","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"} \ No newline at end of file +{"files":{"Cargo.toml":"03ae7e6a133c5fd1685687aee67bc841642a4fd0deeb0d4d88b9fe27af37ba9e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9","README.md":"a01127c37308457e8d396b176fb790846be0978c173be3f13260b62efcef011b","benches/bench.rs":"e2a235d68be20996014c00468b369887d2041ce95486625de3cef35b8f2e4acd","scripts/run_miri.sh":"0d0b8c54c73fa9da1217d29ed0984f8328dd9fb61bb5a02db44458c360cdc3c4","src/arbitrary.rs":"22e55cfbf60374945b30e6d0855129eff67cd8b878cef6fa997e1f4be67b9e3d","src/lib.rs":"264a6e6863aeb21cd779588c2add8421ea1a5861a9bb8ef49e9dc529be8d3b20","src/specialization.rs":"46433586203399251cba496d67b88d34e1be3c2b591986b77463513da1c66471","src/tests.rs":"2bcf69dc0597e4e8a59a92566a3dd5c82ec3a1ea563aa006ea0f4a2722cb2d17","tests/macro.rs":"22ad4f6f104a599fdcba19cad8834105b8656b212fb6c7573a427d447f5db14f"},"package":"2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"} \ No newline at end of file diff --git a/bash-5.1/vendor/smallvec/Cargo.toml b/bash-5.1/vendor/smallvec/Cargo.toml index a365ca18e36d906dafc99abddb665b110d0a8c50..fd490da15e4123abf6c395954d1dbcb398ab383f 100644 --- a/bash-5.1/vendor/smallvec/Cargo.toml +++ b/bash-5.1/vendor/smallvec/Cargo.toml @@ -12,35 +12,18 @@ [package] edition = "2018" name = "smallvec" -version = "1.10.0" +version = "1.9.0" authors = ["The Servo Project Developers"] description = "'Small vector' optimization: store up to a small number of items on the stack" documentation = "https://docs.rs/smallvec/" readme = "README.md" -keywords = [ - "small", - "vec", - "vector", - "stack", - "no_std", -] +keywords = ["small", "vec", "vector", "stack", "no_std"] categories = ["data-structures"] license = "MIT OR Apache-2.0" repository = "https://github.com/servo/rust-smallvec" - [package.metadata.docs.rs] all-features = true -rustdoc-args = [ - "--cfg", - "docsrs", -] - -[[test]] -name = "debugger_visualizer" -path = "tests/debugger_visualizer.rs" -test = false -required-features = ["debugger_visualizer"] - +rustdoc-args = ["--cfg", "docsrs"] [dependencies.arbitrary] version = "1" optional = true @@ -49,20 +32,12 @@ optional = true version = "1" optional = true default-features = false - [dev-dependencies.bincode] version = "1.0.1" -[dev-dependencies.debugger_test] -version = "0.1.0" - -[dev-dependencies.debugger_test_parser] -version = "0.1.0" - [features] const_generics = [] const_new = ["const_generics"] -debugger_visualizer = [] may_dangle = [] specialization = [] union = [] diff --git a/bash-5.1/vendor/smallvec/scripts/run_miri.sh b/bash-5.1/vendor/smallvec/scripts/run_miri.sh index 010ceb06ecb9e734f1d9e5ff50da718d8d322512..817928a09584ddb2a690477f9554a3f17498bace 100644 --- a/bash-5.1/vendor/smallvec/scripts/run_miri.sh +++ b/bash-5.1/vendor/smallvec/scripts/run_miri.sh @@ -11,7 +11,6 @@ cargo clean MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" -rustup override unset rustup default "$MIRI_NIGHTLY" rustup component add miri @@ -20,5 +19,3 @@ cargo miri setup cargo miri test --verbose cargo miri test --verbose --features union cargo miri test --verbose --all-features - -rustup override set nightly diff --git a/bash-5.1/vendor/smallvec/src/lib.rs b/bash-5.1/vendor/smallvec/src/lib.rs index a335ca46c5f68931391a549d40bd49ea503c92c6..921347af8d2f5d92c0ef72972150b7f8e20901cc 100644 --- a/bash-5.1/vendor/smallvec/src/lib.rs +++ b/bash-5.1/vendor/smallvec/src/lib.rs @@ -81,11 +81,6 @@ #![cfg_attr(feature = "specialization", allow(incomplete_features))] #![cfg_attr(feature = "specialization", feature(specialization))] #![cfg_attr(feature = "may_dangle", feature(dropck_eyepatch))] -#![cfg_attr( - feature = "debugger_visualizer", - feature(debugger_visualizer), - debugger_visualizer(natvis_file = "../debug_metadata/smallvec.natvis") -)] #![deny(missing_docs)] #[doc(hidden)] @@ -2089,7 +2084,6 @@ impl SmallVec<[T; N]> { #[cfg_attr(docsrs, doc(cfg(feature = "const_generics")))] unsafe impl Array for [T; N] { type Item = T; - #[inline] fn size() -> usize { N } @@ -2101,7 +2095,6 @@ macro_rules! impl_array( $( unsafe impl Array for [T; $size] { type Item = T; - #[inline] fn size() -> usize { $size } } )+ diff --git a/bash-5.1/vendor/syn/.cargo-checksum.json b/bash-5.1/vendor/syn/.cargo-checksum.json index 8b90dae0f05dc7aa2da6d2bf50c32ebbc450b320..691cc4e061843707b2e3d6fea78df1edb76ea2f9 100644 --- a/bash-5.1/vendor/syn/.cargo-checksum.json +++ b/bash-5.1/vendor/syn/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"8366f3b0e0c3a589f43424b1837bb43aa8b4dd224184d355ad38a63bac915210","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b1546652aefba564455c1ebbf0f276450d4fdb19755e08bfa03c13c8bab241fc","benches/file.rs":"3d737ef3878f6e242b003af9bd539e565f98439a12ee44d9548d84e3fdd7af0c","benches/rust.rs":"11ac9fe898a7bf1bd63e8a8cc9c08bd795b01f0248215cff99afaaf28ce87fab","build.rs":"b815649fd2929d3debd93a58f5da2fb8eba506047a6a5ba538347305828a87b0","src/attr.rs":"234d9cebe2c5e92cd0f5e1117bf5755037e2e905788a337000a65d4bd82b63aa","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"2b48296087f096c9630e1e4b03a00ae703407d1b352902b3197370b2f56c62ff","src/custom_keyword.rs":"5c706fc3611e73d16b8c019d7ecb848a86b1ccfcd9e556f80bb6e6a4abe058a8","src/custom_punctuation.rs":"8a666298e774b0d326642f0f73284f6677d0d0a7c9e4a712c9c98d010b4d8a2c","src/data.rs":"75d2c2b5d6a01bf8a6fa2845e41663d8045a78b4b191f1a1bd7c93619d20017a","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"6c6a9298f8d24f578da119557bc588f3bd928f7b79fca27d6bdfe3e786dd005f","src/error.rs":"e548cc5b7c6f742ab6c19788755980594c4cb8086f99e6709f1cbc982961102d","src/export.rs":"0cf50d70c32d5fddba8b1193032df62e560237c113df3e86ba26b565cc82838e","src/expr.rs":"5eea3828f3291b0ce5463ed5f0c23fc8a39aeceae68a3247ae02ae467dd35a98","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"76e89fe155fedf43bc4a252af7e35319b82ce455f584bad8698fdc3f9b7f5d4e","src/gen/debug.rs":"4b05e474e864ce6bf1a5a6ab48ee6c0ecdf41a0d750237990cf2e31963bc1208","src/gen/eq.rs":"79f84836fdcd5cfa352f38055dab7c3246c7757650946c1c701234b11021652a","src/gen/fold.rs":"fcd6a05c8c8e0c36e7ede8593002528b553c8b648fbed452106fd6a8a8c9212a","src/gen/hash.rs":"575e8beae303c1eabda12bf76cbd82672268c502a8ebb8517aab18b40fdbc44e","src/gen/visit.rs":"ced9f6c17d2b3eb3553faab710cb2b3d44d6bca7d1862c8c5da09c3d45debecb","src/gen/visit_mut.rs":"966ea340c53461bf8a1c6bed3c882e4ab8b8907fd18ac35531266f7891ae5f46","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"46ed41bf116448822ddfefcb62e803fd33264ca8ba672efc0612674d85b6dd11","src/group.rs":"166f0fbb365471ffa3e4f554b72c2b460cbf7e3a1f9bec6c01ef6bbbcd751041","src/ident.rs":"2443e43561abea7eea577b141422258237a663499c839923d8a5ca6fea2470db","src/item.rs":"419c4d6135a7ca7b8f94b5ba038b6af8fcb3939ae807153a19e3c82e9b01e0b7","src/lib.rs":"7875551b227d19f083115d48a83e8c35e3e6d31dbd749bdd03556e2762f7d4fd","src/lifetime.rs":"b18862ef1e690037a4f308ea897debad7bc5038584e3b26c6d8809752ea0e3c2","src/lit.rs":"fc06ddd523f7f9971d8abdb4c8d5d51030ffb3d6810615d5575ae210a7800695","src/lookahead.rs":"e2c2b6d55906421e83dab51463b58bc6dcb582f1bff9303c8b62afefb8d71e5f","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"936f503c2fcde602f05220954ecaf87625c6138d0af13d33d56c7b6530110084","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"7b2f8caddf25a5734cbcdf7cbf043cbf9afbc07b484966cd59ddfcec9f970fb3","src/parse_macro_input.rs":"a5d16859b782bb6a2754c1066468a2f1ea05b57390caa32175bb84064973be7b","src/parse_quote.rs":"d7d996f1382c68b5fbfd4b7327ce1d389cd43c3bb3c4f382a35994d0bb79d8ab","src/pat.rs":"b2de04ae6c01df50eab9d1c3908287aca8424adc2007b926c7bcf74d1f64d40a","src/path.rs":"269d5d8b0c21eaf96e1c49bcb1ec2a03175a8adcc103c142e550b3f5e79825d8","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"f687c23bd3ae512e7412c28ac68030d3bc7a384d1ca8b3da6620e364b0cbbb78","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"601a6914f1e0bf97ae0d31d474a531d195b8c251a4ded11aa8746ac0018d367b","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"7e678749af18fc84ae9220435e467e520de05eea66adeeed3b5d634cd744561c","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/common/eq.rs":"953f5db261a3334eba1d37df4247463e9234c7988da04f43028b5273d24bf2da","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"1b7f875344cb04a7dd3df62deac2f410a9d107c097986e68006d87465f5f5306","tests/debug/mod.rs":"3a6bb799f478101f71c84c6f1a854a58afe2f9db43c39017909346ca20262d94","tests/macros/mod.rs":"aff805b35cfd55aef6a1359ff747e4023afcb08d69d86aff4c19465d29dda088","tests/regression.rs":"f962ebf24007f631f7e702e34e142d07581da7c9a36321ac142cafed1a0afc69","tests/regression/issue1108.rs":"adcc55a42239d344da74216ed85fc14153ddd6ca4dec4872d8339604ba78c185","tests/repo/mod.rs":"1ea18f9430e75cabc4b23b826544c2bf2f950b679a04b237a11e17aabc16e2e9","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"62bb86aaaaf730187a46ff700a8e3b2d1a163039b109b6a483aa44ed2b6806fe","tests/test_expr.rs":"a639728866a063b590430965a4840c01755e398b89be12d8d09b0aa97837ecac","tests/test_generics.rs":"54b7d2afc19aa6e9049585f4c8f7d3f0c29ac3bd11a2c769e9df76f18a4f5ecb","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"a3642c80066f1e7787becfd0278af90a6b7968d6c1249e25e81663aa454cfb2a","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"19740ea9cd4a980bcab9b0dcaa4b032bb6ebb137fa5e4237140b97da1d9679fa","tests/test_meta.rs":"65d4586d131f6cac66694ca5e936748ec4e7f7423af6d8da509240e6be14800b","tests/test_parse_buffer.rs":"68d857f776396d064fcc0023c37093c2fbf75ee68e8241d4014d00d1423c18e9","tests/test_parse_stream.rs":"bf1db6fab7ac396fa61012faccbe6ffbc9c3d795ed2900be75e91c5b09b0c62f","tests/test_pat.rs":"d4465f4fc3fd5d6e534ba8efabe1e0ed6da89de4ac7c96effa6bfb880c4287cf","tests/test_path.rs":"71092a5ae2c9143b92a8fe15a92d39958b3c28bd4d4275cfb2d22cbdd53ada07","tests/test_precedence.rs":"736eee861c4c7a3d7d4387d2fb1b5eced1541790d34974f72b0a5532797e73c3","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"b47662e35be2729f28bacdbbea20f1879c111889430e735a7bcb5f2a5c0b9e5c","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"697906d892ab8186eebdf6bc7696fde7a42376d50bee846ba69f031bdb847e01","tests/test_stmt.rs":"0601fc32131b5501dfcdc4b4248d46bf21e0a98a49eb19439e1a46869dfb30b7","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"f71d7f7f1c038aaabea8dd4c03c0d5752c76d570f8b4885a81659825bbb4d576","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"} \ No newline at end of file +{"files":{"Cargo.toml":"598185e9190166e7f3217ced440d8b3e555ae2a6a84b51ee5ea0a5c7f55bdd0b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b1546652aefba564455c1ebbf0f276450d4fdb19755e08bfa03c13c8bab241fc","benches/file.rs":"39e124e8ebb7f7171af29e87debbcaeb87c1eb465ef1436cfd8f218b340ef580","benches/rust.rs":"22dfbffc39f8d091ef74cca849e7e7c69e9a47f2a06f7dec91c0382401055c14","build.rs":"b815649fd2929d3debd93a58f5da2fb8eba506047a6a5ba538347305828a87b0","src/attr.rs":"234d9cebe2c5e92cd0f5e1117bf5755037e2e905788a337000a65d4bd82b63aa","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"bd5762429e5eb3c899167e820620e7e2a66b4573c48e17326ed12d7461962536","src/custom_keyword.rs":"5c706fc3611e73d16b8c019d7ecb848a86b1ccfcd9e556f80bb6e6a4abe058a8","src/custom_punctuation.rs":"8a666298e774b0d326642f0f73284f6677d0d0a7c9e4a712c9c98d010b4d8a2c","src/data.rs":"75d2c2b5d6a01bf8a6fa2845e41663d8045a78b4b191f1a1bd7c93619d20017a","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"6c6a9298f8d24f578da119557bc588f3bd928f7b79fca27d6bdfe3e786dd005f","src/error.rs":"e548cc5b7c6f742ab6c19788755980594c4cb8086f99e6709f1cbc982961102d","src/export.rs":"0cf50d70c32d5fddba8b1193032df62e560237c113df3e86ba26b565cc82838e","src/expr.rs":"0d441100457567b7b18372fdcbbe833d7516b5a43f17f1cfc4d7f354141b8206","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"c43199af10b9963476a1ef6b9e0540363a8383c611f8999463235a0939817da8","src/gen/debug.rs":"12e07500a09d1d15b7a148d9155af357c7ac9b65ac100906cf0fac604403274e","src/gen/eq.rs":"e0928a9f4e81a7ede04853d1837abccaf29dd4ffb56d864fad2f4c3a4c76f1b4","src/gen/fold.rs":"43b34e7a951c180b65c6dd97c380f067ea91776f52e70f61555bd8a4120170b1","src/gen/hash.rs":"b66425846386e2168990b3bee2461f5c01695acd8c4b6360619a07108b260f3d","src/gen/visit.rs":"d559f661ab4a4c5b058af91ef244f30f906b6be82d1dd61bf0d058236f8c6a35","src/gen/visit_mut.rs":"fe384074919cdb1a6f54b93f8a9c768da7d3751e5bbfaf8c6c7133a7ebd390ae","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"46ed41bf116448822ddfefcb62e803fd33264ca8ba672efc0612674d85b6dd11","src/group.rs":"166f0fbb365471ffa3e4f554b72c2b460cbf7e3a1f9bec6c01ef6bbbcd751041","src/ident.rs":"2443e43561abea7eea577b141422258237a663499c839923d8a5ca6fea2470db","src/item.rs":"2745d8bc068f821fc7dc8f480aceac1d10adc578a0b8b7317eb78f5c9048c68c","src/lib.rs":"143cbfa606d88ed75d3f80a27ca582c4b5285e2e60b78991bec02393ffebf334","src/lifetime.rs":"b18862ef1e690037a4f308ea897debad7bc5038584e3b26c6d8809752ea0e3c2","src/lit.rs":"9134ff103d943cfabdbfae56e78881680f91f9902172b890884a05c58131602a","src/lookahead.rs":"e2c2b6d55906421e83dab51463b58bc6dcb582f1bff9303c8b62afefb8d71e5f","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"936f503c2fcde602f05220954ecaf87625c6138d0af13d33d56c7b6530110084","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"7b2f8caddf25a5734cbcdf7cbf043cbf9afbc07b484966cd59ddfcec9f970fb3","src/parse_macro_input.rs":"88929a1a7e5e72aa2d0b3459e52d8975afea856d159047ba4ab02ecbc5878a9c","src/parse_quote.rs":"d7d996f1382c68b5fbfd4b7327ce1d389cd43c3bb3c4f382a35994d0bb79d8ab","src/pat.rs":"1e0223ca92c160e07b17a593bb93dd5d451fc9b7014012b403377a4f0f21bfce","src/path.rs":"1ad8b8335628f67a013b7ce2f662aa2feab4583ff67bc959a9dea1dcb51be8a3","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"f687c23bd3ae512e7412c28ac68030d3bc7a384d1ca8b3da6620e364b0cbbb78","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"8115bc96090022baad91660d7e5e986664c3f1fbd2f112d1c5d1d77e5c3f227e","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"5c05b000d4884334bed729c3345732fbbb4136a75df9dd5002c493ebb6cd091b","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/.gitignore":"22e782449a3c216db3f7215d5fb8882e316768e40beeec3833aae419ad8941db","tests/common/eq.rs":"529ae94214c0666045a4c16d9beab6c71eedb40e100be8f990674d44480b5ba6","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"4937074a11fe8266431d05177435bad28340763d408d0a4c45bd0c0acc90a86a","tests/debug/mod.rs":"3a6bb799f478101f71c84c6f1a854a58afe2f9db43c39017909346ca20262d94","tests/macros/mod.rs":"aff805b35cfd55aef6a1359ff747e4023afcb08d69d86aff4c19465d29dda088","tests/regression.rs":"f962ebf24007f631f7e702e34e142d07581da7c9a36321ac142cafed1a0afc69","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/repo/mod.rs":"947b678f50df8716ef5c946885a3096e91ab2ec4ce2251cea83d6e6d2ab82eb5","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"62bb86aaaaf730187a46ff700a8e3b2d1a163039b109b6a483aa44ed2b6806fe","tests/test_expr.rs":"a639728866a063b590430965a4840c01755e398b89be12d8d09b0aa97837ecac","tests/test_generics.rs":"54b7d2afc19aa6e9049585f4c8f7d3f0c29ac3bd11a2c769e9df76f18a4f5ecb","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"a3642c80066f1e7787becfd0278af90a6b7968d6c1249e25e81663aa454cfb2a","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"19740ea9cd4a980bcab9b0dcaa4b032bb6ebb137fa5e4237140b97da1d9679fa","tests/test_meta.rs":"65d4586d131f6cac66694ca5e936748ec4e7f7423af6d8da509240e6be14800b","tests/test_parse_buffer.rs":"68d857f776396d064fcc0023c37093c2fbf75ee68e8241d4014d00d1423c18e9","tests/test_parse_stream.rs":"2f449a2c41a3dee6fd14bee24e1666a453cb808eda17332fd91afd127fcdd2a6","tests/test_pat.rs":"d4465f4fc3fd5d6e534ba8efabe1e0ed6da89de4ac7c96effa6bfb880c4287cf","tests/test_path.rs":"71092a5ae2c9143b92a8fe15a92d39958b3c28bd4d4275cfb2d22cbdd53ada07","tests/test_precedence.rs":"1069d979cec0e6c650bebb58be272d23080ce89e83d194dfa2718d22912e481d","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"b47662e35be2729f28bacdbbea20f1879c111889430e735a7bcb5f2a5c0b9e5c","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"1aa0dd489bd844a4a9cf32a5310abd66dad1dae3ffb24fe1288b62a26bfdd8dc","tests/test_stmt.rs":"0601fc32131b5501dfcdc4b4248d46bf21e0a98a49eb19439e1a46869dfb30b7","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"f71d7f7f1c038aaabea8dd4c03c0d5752c76d570f8b4885a81659825bbb4d576","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"} \ No newline at end of file diff --git a/bash-5.1/vendor/syn/Cargo.toml b/bash-5.1/vendor/syn/Cargo.toml index 7b1412593bb2303c3e0a5b635c4496005e86febf..d03ee2e315a1dd9df5b1a568038631cdca3fd2e6 100644 --- a/bash-5.1/vendor/syn/Cargo.toml +++ b/bash-5.1/vendor/syn/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "syn" -version = "1.0.102" +version = "1.0.99" authors = ["David Tolnay "] include = [ "/benches/**", @@ -72,7 +72,7 @@ required-features = [ ] [dependencies.proc-macro2] -version = "1.0.46" +version = "1.0.39" default-features = false [dependencies.quote] diff --git a/bash-5.1/vendor/syn/benches/file.rs b/bash-5.1/vendor/syn/benches/file.rs index bd4a247df662e2c9161520090617c69b1e71a08a..c500dc24a78473d6230ffd86cb56ecd239455d4a 100644 --- a/bash-5.1/vendor/syn/benches/file.rs +++ b/bash-5.1/vendor/syn/benches/file.rs @@ -1,4 +1,4 @@ -// $ cargo bench --features full,test --bench file +// $ cargo bench --features full --bench file #![feature(rustc_private, test)] #![recursion_limit = "1024"] diff --git a/bash-5.1/vendor/syn/benches/rust.rs b/bash-5.1/vendor/syn/benches/rust.rs index e3f8f550abb1a1d47d123e80e68fab29cd225126..5e4fba182dbe6b2e75b9314a6533633eccfe1e7d 100644 --- a/bash-5.1/vendor/syn/benches/rust.rs +++ b/bash-5.1/vendor/syn/benches/rust.rs @@ -1,7 +1,7 @@ -// $ cargo bench --features full,test --bench rust +// $ cargo bench --features full --bench rust // // Syn only, useful for profiling: -// $ RUSTFLAGS='--cfg syn_only' cargo build --release --features full,test --bench rust +// $ RUSTFLAGS='--cfg syn_only' cargo build --release --features full --bench rust #![cfg_attr(not(syn_only), feature(rustc_private))] #![recursion_limit = "1024"] @@ -46,7 +46,7 @@ mod librustc_parse { use rustc_data_structures::sync::Lrc; use rustc_error_messages::FluentBundle; - use rustc_errors::{emitter::Emitter, translation::Translate, Diagnostic, Handler}; + use rustc_errors::{emitter::Emitter, Diagnostic, Handler}; use rustc_session::parse::ParseSess; use rustc_span::source_map::{FilePathMapping, SourceMap}; use rustc_span::{edition::Edition, FileName}; @@ -59,9 +59,6 @@ mod librustc_parse { fn source_map(&self) -> Option<&Lrc> { None } - } - - impl Translate for SilentEmitter { fn fluent_bundle(&self) -> Option<&Lrc> { None } @@ -91,7 +88,7 @@ mod librustc_parse { #[cfg(not(syn_only))] mod read_from_disk { pub fn bench(content: &str) -> Result<(), ()> { - _ = content; + let _ = content; Ok(()) } } diff --git a/bash-5.1/vendor/syn/src/buffer.rs b/bash-5.1/vendor/syn/src/buffer.rs index 161b614c80aa365fa98a5bac1301ab9b9d753ed8..2c8e21bdb2b9a36fe1a502701035aa4e2fb25bc6 100644 --- a/bash-5.1/vendor/syn/src/buffer.rs +++ b/bash-5.1/vendor/syn/src/buffer.rs @@ -14,18 +14,23 @@ use crate::proc_macro as pm; use crate::Lifetime; use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; +use std::hint; use std::marker::PhantomData; +use std::mem; +use std::ptr; +use std::slice; /// Internal type which is used instead of `TokenTree` to represent a token tree /// within a `TokenBuffer`. enum Entry { // Mimicking types from proc-macro. - // Group entries contain the offset to the matching End entry. - Group(Group, usize), + Group(Group, TokenBuffer), Ident(Ident), Punct(Punct), Literal(Literal), - End, + // End entries contain a raw pointer to the entry from the containing + // token tree, or null if this is the outermost level. + End(*const Entry), } /// A buffer that can be efficiently traversed multiple times, unlike @@ -34,29 +39,102 @@ enum Entry { /// /// *This type is available only if Syn is built with the `"parsing"` feature.* pub struct TokenBuffer { - // NOTE: Do not implement clone on this - while the current design could be - // cloned, other designs which could be desirable may not be cloneable. - entries: Box<[Entry]>, + // NOTE: Do not implement clone on this - there are raw pointers inside + // these entries which will be messed up. Moving the `TokenBuffer` itself is + // safe as the data pointed to won't be moved. + ptr: *const Entry, + len: usize, +} + +impl Drop for TokenBuffer { + fn drop(&mut self) { + unsafe { + let slice = slice::from_raw_parts_mut(self.ptr as *mut Entry, self.len); + let _ = Box::from_raw(slice); + } + } } impl TokenBuffer { - fn recursive_new(entries: &mut Vec, stream: TokenStream) { - for tt in stream { + // NOTE: Do not mutate the Vec returned from this function once it returns; + // the address of its backing memory must remain stable. + fn inner_new(stream: TokenStream, up: *const Entry) -> TokenBuffer { + let iterator = stream.into_iter(); + let mut entries = Vec::with_capacity(iterator.size_hint().0 + 1); + let mut next_index_after_last_group = 0; + for tt in iterator { match tt { - TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)), - TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)), - TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)), + TokenTree::Ident(ident) => { + entries.push(Entry::Ident(ident)); + } + TokenTree::Punct(punct) => { + entries.push(Entry::Punct(punct)); + } + TokenTree::Literal(literal) => { + entries.push(Entry::Literal(literal)); + } TokenTree::Group(group) => { - let group_start_index = entries.len(); - entries.push(Entry::End); // we replace this below - Self::recursive_new(entries, group.stream()); - let group_end_index = entries.len(); - entries.push(Entry::End); - let group_end_offset = group_end_index - group_start_index; - entries[group_start_index] = Entry::Group(group, group_end_offset); + // We cannot fill in a real `End` pointer until `entries` is + // finished growing and getting potentially reallocated. + // Instead, we temporarily coopt the spot where the end + // pointer would go, and use it to string together an + // intrusive linked list of all the Entry::Group entries in + // the vector. Later after `entries` is done growing, we'll + // traverse the linked list and fill in all the end + // pointers with a correct value. + let group_up = + ptr::null::().wrapping_add(next_index_after_last_group) as *const Entry; + + let inner = Self::inner_new(group.stream(), group_up); + entries.push(Entry::Group(group, inner)); + next_index_after_last_group = entries.len(); } } } + + // Add an `End` entry to the end with a reference to the enclosing token + // stream which was passed in. + entries.push(Entry::End(up)); + + // NOTE: This is done to ensure that we don't accidentally modify the + // length of the backing buffer. The backing buffer must remain at a + // constant address after this point, as we are going to store a raw + // pointer into it. + let entries = entries.into_boxed_slice(); + let len = entries.len(); + + // Convert boxed slice into a pointer to the first element early, to + // avoid invalidating pointers into this slice when we move the Box. + // See https://github.com/rust-lang/unsafe-code-guidelines/issues/326 + let entries = Box::into_raw(entries) as *mut Entry; + + // Traverse intrusive linked list of Entry::Group entries and fill in + // correct End pointers. + while let Some(idx) = next_index_after_last_group.checked_sub(1) { + // We know that idx refers to one of the Entry::Group entries, and + // that the very last entry is an Entry::End, so the next index + // after any group entry is a valid index. + let group_up = unsafe { entries.add(next_index_after_last_group) }; + + // Linked list only takes us to entries which are of type Group. + let token_buffer = match unsafe { &*entries.add(idx) } { + Entry::Group(_group, token_buffer) => token_buffer, + _ => unsafe { hint::unreachable_unchecked() }, + }; + + // Last entry in any TokenBuffer is of type End. + let buffer_ptr = token_buffer.ptr as *mut Entry; + let last_entry = unsafe { &mut *buffer_ptr.add(token_buffer.len - 1) }; + let end_ptr_slot = match last_entry { + Entry::End(end_ptr_slot) => end_ptr_slot, + _ => unsafe { hint::unreachable_unchecked() }, + }; + + // Step to next element in linked list. + next_index_after_last_group = mem::replace(end_ptr_slot, group_up) as usize; + } + + TokenBuffer { ptr: entries, len } } /// Creates a `TokenBuffer` containing all the tokens from the input @@ -75,19 +153,13 @@ impl TokenBuffer { /// Creates a `TokenBuffer` containing all the tokens from the input /// `proc_macro2::TokenStream`. pub fn new2(stream: TokenStream) -> Self { - let mut entries = Vec::new(); - Self::recursive_new(&mut entries, stream); - entries.push(Entry::End); - Self { - entries: entries.into_boxed_slice(), - } + Self::inner_new(stream, ptr::null()) } /// Creates a cursor referencing the first token in the buffer and able to /// traverse until the end of the buffer. pub fn begin(&self) -> Cursor { - let ptr = self.entries.as_ptr(); - unsafe { Cursor::create(ptr, ptr.add(self.entries.len() - 1)) } + unsafe { Cursor::create(self.ptr, self.ptr.add(self.len - 1)) } } } @@ -107,7 +179,7 @@ impl TokenBuffer { pub struct Cursor<'a> { // The current entry which the `Cursor` is pointing at. ptr: *const Entry, - // This is the only `Entry::End` object which this cursor is allowed to + // This is the only `Entry::End(..)` object which this cursor is allowed to // point at. All other `End` objects are skipped over in `Cursor::create`. scope: *const Entry, // Cursor is covariant in 'a. This field ensures that our pointers are still @@ -127,7 +199,7 @@ impl<'a> Cursor<'a> { // object in global storage. struct UnsafeSyncEntry(Entry); unsafe impl Sync for UnsafeSyncEntry {} - static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End); + static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0 as *const Entry)); Cursor { ptr: &EMPTY_ENTRY.0, @@ -140,15 +212,15 @@ impl<'a> Cursor<'a> { /// `None`-delimited scopes when the cursor reaches the end of them, /// allowing for them to be treated transparently. unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self { - // NOTE: If we're looking at a `End`, we want to advance the cursor + // NOTE: If we're looking at a `End(..)`, we want to advance the cursor // past it, unless `ptr == scope`, which means that we're at the edge of // our cursor's scope. We should only have `ptr != scope` at the exit // from None-delimited groups entered with `ignore_none`. - while let Entry::End = *ptr { + while let Entry::End(exit) = *ptr { if ptr == scope { break; } - ptr = ptr.add(1); + ptr = exit; } Cursor { @@ -166,10 +238,7 @@ impl<'a> Cursor<'a> { /// Bump the cursor to point at the next token after the current one. This /// is undefined behavior if the cursor is currently looking at an /// `Entry::End`. - /// - /// If the cursor is looking at an `Entry::Group`, the bumped cursor will - /// point at the first token in the group (with the same scope end). - unsafe fn bump_ignore_group(self) -> Cursor<'a> { + unsafe fn bump(self) -> Cursor<'a> { Cursor::create(self.ptr.offset(1), self.scope) } @@ -179,9 +248,14 @@ impl<'a> Cursor<'a> { /// /// WARNING: This mutates its argument. fn ignore_none(&mut self) { - while let Entry::Group(group, _) = self.entry() { + while let Entry::Group(group, buf) = self.entry() { if group.delimiter() == Delimiter::None { - unsafe { *self = self.bump_ignore_group() }; + // NOTE: We call `Cursor::create` here to make sure that + // situations where we should immediately exit the span after + // entering it are handled correctly. + unsafe { + *self = Cursor::create(buf.ptr, self.scope); + } } else { break; } @@ -205,12 +279,9 @@ impl<'a> Cursor<'a> { self.ignore_none(); } - if let Entry::Group(group, end_offset) = self.entry() { + if let Entry::Group(group, buf) = self.entry() { if group.delimiter() == delim { - let end_of_group = unsafe { self.ptr.add(*end_offset) }; - let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) }; - let after_group = unsafe { Cursor::create(end_of_group, self.scope) }; - return Some((inside_of_group, group.span(), after_group)); + return Some((buf.begin(), group.span(), unsafe { self.bump() })); } } @@ -222,7 +293,7 @@ impl<'a> Cursor<'a> { pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> { self.ignore_none(); match self.entry() { - Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump_ignore_group() })), + Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump() })), _ => None, } } @@ -233,7 +304,7 @@ impl<'a> Cursor<'a> { self.ignore_none(); match self.entry() { Entry::Punct(punct) if punct.as_char() != '\'' => { - Some((punct.clone(), unsafe { self.bump_ignore_group() })) + Some((punct.clone(), unsafe { self.bump() })) } _ => None, } @@ -244,7 +315,7 @@ impl<'a> Cursor<'a> { pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> { self.ignore_none(); match self.entry() { - Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump_ignore_group() })), + Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump() })), _ => None, } } @@ -255,13 +326,17 @@ impl<'a> Cursor<'a> { self.ignore_none(); match self.entry() { Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => { - let next = unsafe { self.bump_ignore_group() }; - let (ident, rest) = next.ident()?; - let lifetime = Lifetime { - apostrophe: punct.span(), - ident, - }; - Some((lifetime, rest)) + let next = unsafe { self.bump() }; + match next.ident() { + Some((ident, rest)) => { + let lifetime = Lifetime { + apostrophe: punct.span(), + ident, + }; + Some((lifetime, rest)) + } + None => None, + } } _ => None, } @@ -287,16 +362,15 @@ impl<'a> Cursor<'a> { /// This method does not treat `None`-delimited groups as transparent, and /// will return a `Group(None, ..)` if the cursor is looking at one. pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> { - let (tree, len) = match self.entry() { - Entry::Group(group, end_offset) => (group.clone().into(), *end_offset), - Entry::Literal(literal) => (literal.clone().into(), 1), - Entry::Ident(ident) => (ident.clone().into(), 1), - Entry::Punct(punct) => (punct.clone().into(), 1), - Entry::End => return None, + let tree = match self.entry() { + Entry::Group(group, _) => group.clone().into(), + Entry::Literal(literal) => literal.clone().into(), + Entry::Ident(ident) => ident.clone().into(), + Entry::Punct(punct) => punct.clone().into(), + Entry::End(..) => return None, }; - let rest = unsafe { Cursor::create(self.ptr.add(len), self.scope) }; - Some((tree, rest)) + Some((tree, unsafe { self.bump() })) } /// Returns the `Span` of the current token, or `Span::call_site()` if this @@ -307,7 +381,7 @@ impl<'a> Cursor<'a> { Entry::Literal(literal) => literal.span(), Entry::Ident(ident) => ident.span(), Entry::Punct(punct) => punct.span(), - Entry::End => Span::call_site(), + Entry::End(..) => Span::call_site(), } } @@ -316,22 +390,19 @@ impl<'a> Cursor<'a> { /// /// This method treats `'lifetimes` as a single token. pub(crate) fn skip(self) -> Option> { - let len = match self.entry() { - Entry::End => return None, + match self.entry() { + Entry::End(..) => None, // Treat lifetimes as a single tt for the purposes of 'skip'. Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => { - match unsafe { &*self.ptr.add(1) } { - Entry::Ident(_) => 2, - _ => 1, + let next = unsafe { self.bump() }; + match next.entry() { + Entry::Ident(_) => Some(unsafe { next.bump() }), + _ => Some(next), } } - - Entry::Group(_, end_offset) => *end_offset, - _ => 1, - }; - - Some(unsafe { Cursor::create(self.ptr.add(len), self.scope) }) + _ => Some(unsafe { self.bump() }), + } } } diff --git a/bash-5.1/vendor/syn/src/expr.rs b/bash-5.1/vendor/syn/src/expr.rs index 93a59b0e20d77e391e1cc4b6619c74d829824998..cf0fa0af96239e909e7f945edfceed9225a4fe24 100644 --- a/bash-5.1/vendor/syn/src/expr.rs +++ b/bash-5.1/vendor/syn/src/expr.rs @@ -1371,9 +1371,7 @@ pub(crate) mod parsing { }); } else if Precedence::Cast >= base && input.peek(Token![as]) { let as_token: Token![as] = input.parse()?; - let allow_plus = false; - let allow_group_generic = false; - let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?; + let ty = input.call(Type::without_plus)?; check_cast(input)?; lhs = Expr::Cast(ExprCast { attrs: Vec::new(), @@ -1383,9 +1381,7 @@ pub(crate) mod parsing { }); } else if Precedence::Cast >= base && input.peek(Token![:]) && !input.peek(Token![::]) { let colon_token: Token![:] = input.parse()?; - let allow_plus = false; - let allow_group_generic = false; - let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?; + let ty = input.call(Type::without_plus)?; check_cast(input)?; lhs = Expr::Type(ExprType { attrs: Vec::new(), @@ -1433,9 +1429,7 @@ pub(crate) mod parsing { }); } else if Precedence::Cast >= base && input.peek(Token![as]) { let as_token: Token![as] = input.parse()?; - let allow_plus = false; - let allow_group_generic = false; - let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?; + let ty = input.call(Type::without_plus)?; check_cast(input)?; lhs = Expr::Cast(ExprCast { attrs: Vec::new(), @@ -1733,10 +1727,7 @@ pub(crate) mod parsing { || input.peek(Token![move]) { expr_closure(input, allow_struct).map(Expr::Closure) - } else if input.peek(Token![for]) - && input.peek2(Token![<]) - && (input.peek3(Lifetime) || input.peek3(Token![>])) - { + } else if input.peek(Token![for]) && input.peek2(Token![<]) && input.peek3(Lifetime) { let begin = input.fork(); input.parse::()?; expr_closure(input, allow_struct)?; @@ -2019,9 +2010,7 @@ pub(crate) mod parsing { Expr::If(input.parse()?) } else if input.peek(Token![while]) { Expr::While(input.parse()?) - } else if input.peek(Token![for]) - && !(input.peek2(Token![<]) && (input.peek3(Lifetime) || input.peek3(Token![>]))) - { + } else if input.peek(Token![for]) { Expr::ForLoop(input.parse()?) } else if input.peek(Token![loop]) { Expr::Loop(input.parse()?) diff --git a/bash-5.1/vendor/syn/src/gen/clone.rs b/bash-5.1/vendor/syn/src/gen/clone.rs index a413e3ec700c8af0973c3f8428191afe84aa6f77..8de1cd8c92a09cf834caec58b816a251affa2dc9 100644 --- a/bash-5.1/vendor/syn/src/gen/clone.rs +++ b/bash-5.1/vendor/syn/src/gen/clone.rs @@ -910,9 +910,9 @@ impl Clone for GenericArgument { match self { GenericArgument::Lifetime(v0) => GenericArgument::Lifetime(v0.clone()), GenericArgument::Type(v0) => GenericArgument::Type(v0.clone()), - GenericArgument::Const(v0) => GenericArgument::Const(v0.clone()), GenericArgument::Binding(v0) => GenericArgument::Binding(v0.clone()), GenericArgument::Constraint(v0) => GenericArgument::Constraint(v0.clone()), + GenericArgument::Const(v0) => GenericArgument::Const(v0.clone()), } } } diff --git a/bash-5.1/vendor/syn/src/gen/debug.rs b/bash-5.1/vendor/syn/src/gen/debug.rs index a1f0afa790c05c9d440e72d42beb2a1cc4ac3690..4adf8c593661d84aeb9d8794489764241efa6291 100644 --- a/bash-5.1/vendor/syn/src/gen/debug.rs +++ b/bash-5.1/vendor/syn/src/gen/debug.rs @@ -1268,11 +1268,6 @@ impl Debug for GenericArgument { formatter.field(v0); formatter.finish() } - GenericArgument::Const(v0) => { - let mut formatter = formatter.debug_tuple("Const"); - formatter.field(v0); - formatter.finish() - } GenericArgument::Binding(v0) => { let mut formatter = formatter.debug_tuple("Binding"); formatter.field(v0); @@ -1283,6 +1278,11 @@ impl Debug for GenericArgument { formatter.field(v0); formatter.finish() } + GenericArgument::Const(v0) => { + let mut formatter = formatter.debug_tuple("Const"); + formatter.field(v0); + formatter.finish() + } } } } diff --git a/bash-5.1/vendor/syn/src/gen/eq.rs b/bash-5.1/vendor/syn/src/gen/eq.rs index 20acb809d8585a3d8d7a59db4e6c9b3bb6d736bb..40fed0b8906526b079d2915e8f76a76aa2063308 100644 --- a/bash-5.1/vendor/syn/src/gen/eq.rs +++ b/bash-5.1/vendor/syn/src/gen/eq.rs @@ -878,15 +878,15 @@ impl PartialEq for GenericArgument { (GenericArgument::Type(self0), GenericArgument::Type(other0)) => { self0 == other0 } - (GenericArgument::Const(self0), GenericArgument::Const(other0)) => { - self0 == other0 - } (GenericArgument::Binding(self0), GenericArgument::Binding(other0)) => { self0 == other0 } (GenericArgument::Constraint(self0), GenericArgument::Constraint(other0)) => { self0 == other0 } + (GenericArgument::Const(self0), GenericArgument::Const(other0)) => { + self0 == other0 + } _ => false, } } diff --git a/bash-5.1/vendor/syn/src/gen/fold.rs b/bash-5.1/vendor/syn/src/gen/fold.rs index 98bb5794aab9f49e098ba2842736fa4f4120a9fc..6e19e6f3a86de22293848bb60f5612451cd74e55 100644 --- a/bash-5.1/vendor/syn/src/gen/fold.rs +++ b/bash-5.1/vendor/syn/src/gen/fold.rs @@ -1787,15 +1787,15 @@ where GenericArgument::Type(_binding_0) => { GenericArgument::Type(f.fold_type(_binding_0)) } - GenericArgument::Const(_binding_0) => { - GenericArgument::Const(f.fold_expr(_binding_0)) - } GenericArgument::Binding(_binding_0) => { GenericArgument::Binding(f.fold_binding(_binding_0)) } GenericArgument::Constraint(_binding_0) => { GenericArgument::Constraint(f.fold_constraint(_binding_0)) } + GenericArgument::Const(_binding_0) => { + GenericArgument::Const(f.fold_expr(_binding_0)) + } } } #[cfg(feature = "full")] diff --git a/bash-5.1/vendor/syn/src/gen/hash.rs b/bash-5.1/vendor/syn/src/gen/hash.rs index d0400e19d6d8c6d3ef6187387d3352a9a6a91751..f68a7630e291eda65b0b9e41cb725b1ade1aee71 100644 --- a/bash-5.1/vendor/syn/src/gen/hash.rs +++ b/bash-5.1/vendor/syn/src/gen/hash.rs @@ -1184,15 +1184,15 @@ impl Hash for GenericArgument { state.write_u8(1u8); v0.hash(state); } - GenericArgument::Const(v0) => { + GenericArgument::Binding(v0) => { state.write_u8(2u8); v0.hash(state); } - GenericArgument::Binding(v0) => { + GenericArgument::Constraint(v0) => { state.write_u8(3u8); v0.hash(state); } - GenericArgument::Constraint(v0) => { + GenericArgument::Const(v0) => { state.write_u8(4u8); v0.hash(state); } diff --git a/bash-5.1/vendor/syn/src/gen/visit.rs b/bash-5.1/vendor/syn/src/gen/visit.rs index 19ddd2e726025c4ddbd3bebf545b7f41fb999f30..051b6593683824a52ab32525a789fb140d1f7cea 100644 --- a/bash-5.1/vendor/syn/src/gen/visit.rs +++ b/bash-5.1/vendor/syn/src/gen/visit.rs @@ -1974,15 +1974,15 @@ where GenericArgument::Type(_binding_0) => { v.visit_type(_binding_0); } - GenericArgument::Const(_binding_0) => { - v.visit_expr(_binding_0); - } GenericArgument::Binding(_binding_0) => { v.visit_binding(_binding_0); } GenericArgument::Constraint(_binding_0) => { v.visit_constraint(_binding_0); } + GenericArgument::Const(_binding_0) => { + v.visit_expr(_binding_0); + } } } #[cfg(feature = "full")] diff --git a/bash-5.1/vendor/syn/src/gen/visit_mut.rs b/bash-5.1/vendor/syn/src/gen/visit_mut.rs index 239709d19410717f81a36f9b3409e2b418bfd6c3..3ddbe9c0675f6aa38911af42e32854f37de679cc 100644 --- a/bash-5.1/vendor/syn/src/gen/visit_mut.rs +++ b/bash-5.1/vendor/syn/src/gen/visit_mut.rs @@ -1975,15 +1975,15 @@ where GenericArgument::Type(_binding_0) => { v.visit_type_mut(_binding_0); } - GenericArgument::Const(_binding_0) => { - v.visit_expr_mut(_binding_0); - } GenericArgument::Binding(_binding_0) => { v.visit_binding_mut(_binding_0); } GenericArgument::Constraint(_binding_0) => { v.visit_constraint_mut(_binding_0); } + GenericArgument::Const(_binding_0) => { + v.visit_expr_mut(_binding_0); + } } } #[cfg(feature = "full")] diff --git a/bash-5.1/vendor/syn/src/item.rs b/bash-5.1/vendor/syn/src/item.rs index a1ef7ab43eff360a167ba5bde8ef731d72b028b1..1ce970ee2b426c9b44f1457ce7fc4b5ed9f94628 100644 --- a/bash-5.1/vendor/syn/src/item.rs +++ b/bash-5.1/vendor/syn/src/item.rs @@ -2765,6 +2765,7 @@ mod printing { use super::*; use crate::attr::FilterAttrs; use crate::print::TokensOrDefault; + use crate::punctuated::Pair; use proc_macro2::TokenStream; use quote::{ToTokens, TokenStreamExt}; @@ -3282,9 +3283,16 @@ mod printing { self.generics.to_tokens(tokens); self.paren_token.surround(tokens, |tokens| { let mut last_is_variadic = false; - for pair in self.inputs.pairs() { - last_is_variadic = maybe_variadic_to_tokens(pair.value(), tokens); - pair.punct().to_tokens(tokens); + for input in self.inputs.pairs() { + match input { + Pair::Punctuated(input, comma) => { + maybe_variadic_to_tokens(input, tokens); + comma.to_tokens(tokens); + } + Pair::End(input) => { + last_is_variadic = maybe_variadic_to_tokens(input, tokens); + } + } } if self.variadic.is_some() && !last_is_variadic { if !self.inputs.empty_or_trailing() { diff --git a/bash-5.1/vendor/syn/src/lib.rs b/bash-5.1/vendor/syn/src/lib.rs index 81f03e1b5514a3365ed8f81611d4cab17520c4f9..09addd3a6ad6514f29ba4f968a34ea2726df0172 100644 --- a/bash-5.1/vendor/syn/src/lib.rs +++ b/bash-5.1/vendor/syn/src/lib.rs @@ -250,11 +250,10 @@ //! dynamic library libproc_macro from rustc toolchain. // Syn types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/syn/1.0.102")] +#![doc(html_root_url = "https://docs.rs/syn/1.0.99")] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow(non_camel_case_types)] #![allow( - clippy::bool_to_int_with_if, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_ptr_alignment, @@ -813,6 +812,14 @@ mod print; //////////////////////////////////////////////////////////////////////////////// +// https://github.com/rust-lang/rust/issues/62830 +#[cfg(feature = "parsing")] +mod rustdoc_workaround { + pub use crate::parse::{self as parse_module}; +} + +//////////////////////////////////////////////////////////////////////////////// + mod error; pub use crate::error::{Error, Result}; diff --git a/bash-5.1/vendor/syn/src/lit.rs b/bash-5.1/vendor/syn/src/lit.rs index 130b40ed1fb7cc2a30adbaa9455e153755e785ce..2600dc80108cb2860653228d2cfbc17554169799 100644 --- a/bash-5.1/vendor/syn/src/lit.rs +++ b/bash-5.1/vendor/syn/src/lit.rs @@ -224,7 +224,7 @@ impl LitStr { // Parse string literal into a token stream with every span equal to the // original literal's span. - let mut tokens = TokenStream::from_str(&self.value())?; + let mut tokens = crate::parse_str(&self.value())?; tokens = respan_token_stream(tokens, self.span()); parser.parse2(tokens) diff --git a/bash-5.1/vendor/syn/src/parse_macro_input.rs b/bash-5.1/vendor/syn/src/parse_macro_input.rs index 6163cd70af7b046b736fa6b300eadaacb299fb20..8e1a5ec6b95c1ac286d0f8360a7fc8f9553e32b4 100644 --- a/bash-5.1/vendor/syn/src/parse_macro_input.rs +++ b/bash-5.1/vendor/syn/src/parse_macro_input.rs @@ -4,7 +4,7 @@ /// Refer to the [`parse` module] documentation for more details about parsing /// in Syn. /// -/// [`parse` module]: mod@crate::parse +/// [`parse` module]: crate::rustdoc_workaround::parse_module /// ///
/// @@ -51,7 +51,7 @@ /// This macro can also be used with the [`Parser` trait] for types that have /// multiple ways that they can be parsed. /// -/// [`Parser` trait]: crate::parse::Parser +/// [`Parser` trait]: crate::rustdoc_workaround::parse_module::Parser /// /// ``` /// # extern crate proc_macro; diff --git a/bash-5.1/vendor/syn/src/pat.rs b/bash-5.1/vendor/syn/src/pat.rs index b279186aa0634b85713c4e587d45301cbb46cf58..fa0818c16a4080b6d775adc6edf71467a72d419d 100644 --- a/bash-5.1/vendor/syn/src/pat.rs +++ b/bash-5.1/vendor/syn/src/pat.rs @@ -400,11 +400,11 @@ pub mod parsing { } if input.peek(token::Brace) { - let pat = pat_struct(begin.fork(), input, path)?; + let pat = pat_struct(input, path)?; if qself.is_some() { Ok(Pat::Verbatim(verbatim::between(begin, input))) } else { - Ok(pat) + Ok(Pat::Struct(pat)) } } else if input.peek(token::Paren) { let pat = pat_tuple_struct(input, path)?; @@ -465,23 +465,13 @@ pub mod parsing { }) } - fn pat_struct(begin: ParseBuffer, input: ParseStream, path: Path) -> Result { + fn pat_struct(input: ParseStream, path: Path) -> Result { let content; let brace_token = braced!(content in input); let mut fields = Punctuated::new(); - let mut dot2_token = None; - while !content.is_empty() { - let attrs = content.call(Attribute::parse_outer)?; - if content.peek(Token![..]) { - dot2_token = Some(content.parse()?); - if !attrs.is_empty() { - return Ok(Pat::Verbatim(verbatim::between(begin, input))); - } - break; - } - let mut value = content.call(field_pat)?; - value.attrs = attrs; + while !content.is_empty() && !content.peek(Token![..]) { + let value = content.call(field_pat)?; fields.push_value(value); if content.is_empty() { break; @@ -490,13 +480,19 @@ pub mod parsing { fields.push_punct(punct); } - Ok(Pat::Struct(PatStruct { + let dot2_token = if fields.empty_or_trailing() && content.peek(Token![..]) { + Some(content.parse()?) + } else { + None + }; + + Ok(PatStruct { attrs: Vec::new(), path, brace_token, fields, dot2_token, - })) + }) } impl Member { @@ -509,6 +505,7 @@ pub mod parsing { } fn field_pat(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; let boxed: Option = input.parse()?; let by_ref: Option = input.parse()?; let mutability: Option = input.parse()?; @@ -518,7 +515,7 @@ pub mod parsing { || member.is_unnamed() { return Ok(FieldPat { - attrs: Vec::new(), + attrs, member, colon_token: input.parse()?, pat: Box::new(multi_pat_with_leading_vert(input)?), @@ -547,7 +544,7 @@ pub mod parsing { } Ok(FieldPat { - attrs: Vec::new(), + attrs, member: Member::Named(ident), colon_token: None, pat: Box::new(pat), diff --git a/bash-5.1/vendor/syn/src/path.rs b/bash-5.1/vendor/syn/src/path.rs index 742273afdc06e04a8dee4130919931b192ca14a9..00be352b15c68910f7c3b5902cb7fecbc1a29710 100644 --- a/bash-5.1/vendor/syn/src/path.rs +++ b/bash-5.1/vendor/syn/src/path.rs @@ -109,16 +109,16 @@ ast_enum! { Lifetime(Lifetime), /// A type argument. Type(Type), - /// A const expression. Must be inside of a block. - /// - /// NOTE: Identity expressions are represented as Type arguments, as - /// they are indistinguishable syntactically. - Const(Expr), /// A binding (equality constraint) on an associated type: the `Item = /// u8` in `Iterator`. Binding(Binding), /// An associated type bound: `Iterator`. Constraint(Constraint), + /// A const expression. Must be inside of a block. + /// + /// NOTE: Identity expressions are represented as Type arguments, as + /// they are indistinguishable syntactically. + Const(Expr), } } @@ -729,6 +729,8 @@ pub(crate) mod printing { match self { GenericArgument::Lifetime(lt) => lt.to_tokens(tokens), GenericArgument::Type(ty) => ty.to_tokens(tokens), + GenericArgument::Binding(tb) => tb.to_tokens(tokens), + GenericArgument::Constraint(tc) => tc.to_tokens(tokens), GenericArgument::Const(e) => match *e { Expr::Lit(_) => e.to_tokens(tokens), @@ -744,8 +746,6 @@ pub(crate) mod printing { e.to_tokens(tokens); }), }, - GenericArgument::Binding(tb) => tb.to_tokens(tokens), - GenericArgument::Constraint(tc) => tc.to_tokens(tokens), } } } @@ -756,8 +756,11 @@ pub(crate) mod printing { self.colon2_token.to_tokens(tokens); self.lt_token.to_tokens(tokens); - // Print lifetimes before types/consts/bindings, regardless of their - // order in self.args. + // Print lifetimes before types and consts, all before bindings, + // regardless of their order in self.args. + // + // TODO: ordering rules for const arguments vs type arguments have + // not been settled yet. https://github.com/rust-lang/rust/issues/44580 let mut trailing_or_empty = true; for param in self.args.pairs() { match **param.value() { @@ -766,24 +769,37 @@ pub(crate) mod printing { trailing_or_empty = param.punct().is_some(); } GenericArgument::Type(_) - | GenericArgument::Const(_) | GenericArgument::Binding(_) - | GenericArgument::Constraint(_) => {} + | GenericArgument::Constraint(_) + | GenericArgument::Const(_) => {} } } for param in self.args.pairs() { match **param.value() { - GenericArgument::Type(_) - | GenericArgument::Const(_) + GenericArgument::Type(_) | GenericArgument::Const(_) => { + if !trailing_or_empty { + ::default().to_tokens(tokens); + } + param.to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + GenericArgument::Lifetime(_) | GenericArgument::Binding(_) - | GenericArgument::Constraint(_) => { + | GenericArgument::Constraint(_) => {} + } + } + for param in self.args.pairs() { + match **param.value() { + GenericArgument::Binding(_) | GenericArgument::Constraint(_) => { if !trailing_or_empty { ::default().to_tokens(tokens); } param.to_tokens(tokens); trailing_or_empty = param.punct().is_some(); } - GenericArgument::Lifetime(_) => {} + GenericArgument::Lifetime(_) + | GenericArgument::Type(_) + | GenericArgument::Const(_) => {} } } diff --git a/bash-5.1/vendor/syn/src/stmt.rs b/bash-5.1/vendor/syn/src/stmt.rs index 58bd013ecf4c4ee59be63b52fc779869d3942a3c..3e2c71bdd6d26cedd683e22d72e5e803397eacff 100644 --- a/bash-5.1/vendor/syn/src/stmt.rs +++ b/bash-5.1/vendor/syn/src/stmt.rs @@ -175,11 +175,7 @@ pub mod parsing { || input.peek(Token![crate]) && !input.peek2(Token![::]) || input.peek(Token![extern]) || input.peek(Token![use]) - || input.peek(Token![static]) - && (input.peek2(Token![mut]) - || input.peek2(Ident) - && !(input.peek2(Token![async]) - && (input.peek3(Token![move]) || input.peek3(Token![|])))) + || input.peek(Token![static]) && (input.peek2(Token![mut]) || input.peek2(Ident)) || input.peek(Token![const]) && !input.peek2(token::Brace) || input.peek(Token![unsafe]) && !input.peek2(token::Brace) || input.peek(Token![async]) diff --git a/bash-5.1/vendor/syn/src/ty.rs b/bash-5.1/vendor/syn/src/ty.rs index 4068be3c754bb8886880ca69edd655a5376ff5e5..0f1341fddda5d42a81741be747a83e25a9310c53 100644 --- a/bash-5.1/vendor/syn/src/ty.rs +++ b/bash-5.1/vendor/syn/src/ty.rs @@ -343,8 +343,7 @@ pub mod parsing { impl Parse for Type { fn parse(input: ParseStream) -> Result { let allow_plus = true; - let allow_group_generic = true; - ambig_ty(input, allow_plus, allow_group_generic) + ambig_ty(input, allow_plus) } } @@ -357,16 +356,11 @@ pub mod parsing { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] pub fn without_plus(input: ParseStream) -> Result { let allow_plus = false; - let allow_group_generic = true; - ambig_ty(input, allow_plus, allow_group_generic) + ambig_ty(input, allow_plus) } } - pub(crate) fn ambig_ty( - input: ParseStream, - allow_plus: bool, - allow_group_generic: bool, - ) -> Result { + fn ambig_ty(input: ParseStream, allow_plus: bool) -> Result { let begin = input.fork(); if input.peek(token::Group) { @@ -387,9 +381,7 @@ pub mod parsing { path: Path::parse_helper(input, false)?, })); } - } else if input.peek(Token![<]) && allow_group_generic - || input.peek(Token![::]) && input.peek3(Token![<]) - { + } else if input.peek(Token![<]) || input.peek(Token![::]) && input.peek3(Token![<]) { if let Type::Path(mut ty) = *group.elem { let arguments = &mut ty.path.segments.last_mut().unwrap().arguments; if let PathArguments::None = arguments { @@ -545,15 +537,9 @@ pub mod parsing { || lookahead.peek(Token![::]) || lookahead.peek(Token![<]) { - let dyn_token: Option = input.parse()?; - if dyn_token.is_some() { - let star_token: Option = input.parse()?; - let bounds = TypeTraitObject::parse_bounds(input, allow_plus)?; - return Ok(if star_token.is_some() { - Type::Verbatim(verbatim::between(begin, input)) - } else { - Type::TraitObject(TypeTraitObject { dyn_token, bounds }) - }); + if input.peek(Token![dyn]) { + let trait_object = TypeTraitObject::parse(input, allow_plus)?; + return Ok(Type::TraitObject(trait_object)); } let ty: TypePath = input.parse()?; @@ -833,28 +819,15 @@ pub mod parsing { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for TypePath { fn parse(input: ParseStream) -> Result { - let expr_style = false; - let (qself, mut path) = path::parsing::qpath(input, expr_style)?; + let (qself, mut path) = path::parsing::qpath(input, false)?; - while path.segments.last().unwrap().arguments.is_empty() + if path.segments.last().unwrap().arguments.is_empty() && (input.peek(token::Paren) || input.peek(Token![::]) && input.peek3(token::Paren)) { input.parse::>()?; let args: ParenthesizedGenericArguments = input.parse()?; - let allow_associated_type = cfg!(feature = "full") - && match &args.output { - ReturnType::Default => true, - ReturnType::Type(_, ty) => match **ty { - // TODO: probably some of the other kinds allow this too. - Type::Paren(_) => true, - _ => false, - }, - }; let parenthesized = PathArguments::Parenthesized(args); path.segments.last_mut().unwrap().arguments = parenthesized; - if allow_associated_type { - Path::parse_rest(input, &mut path, expr_style)?; - } } Ok(TypePath { qself, path }) @@ -871,8 +844,7 @@ pub mod parsing { pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result { if input.peek(Token![->]) { let arrow = input.parse()?; - let allow_group_generic = true; - let ty = ambig_ty(input, allow_plus, allow_group_generic)?; + let ty = ambig_ty(input, allow_plus)?; Ok(ReturnType::Type(arrow, Box::new(ty))) } else { Ok(ReturnType::Default) @@ -995,10 +967,7 @@ pub mod parsing { let content; Ok(TypeParen { paren_token: parenthesized!(content in input), - elem: Box::new({ - let allow_group_generic = true; - ambig_ty(&content, allow_plus, allow_group_generic)? - }), + elem: Box::new(ambig_ty(&content, allow_plus)?), }) } } diff --git a/bash-5.1/vendor/syn/tests/.gitignore b/bash-5.1/vendor/syn/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..291ed43a2a78228b7e60fab8e9fe1d4202a0cfb5 --- /dev/null +++ b/bash-5.1/vendor/syn/tests/.gitignore @@ -0,0 +1 @@ +/*.pending-snap diff --git a/bash-5.1/vendor/syn/tests/common/eq.rs b/bash-5.1/vendor/syn/tests/common/eq.rs index a531462415ca281985c68c91b52dfe952ab06044..ff100aa4124ca666c5c401d0510747edd613183e 100644 --- a/bash-5.1/vendor/syn/tests/common/eq.rs +++ b/bash-5.1/vendor/syn/tests/common/eq.rs @@ -3,7 +3,6 @@ extern crate rustc_ast; extern crate rustc_data_structures; extern crate rustc_span; -extern crate thin_vec; use rustc_ast::ast::AngleBracketedArg; use rustc_ast::ast::AngleBracketedArgs; @@ -20,11 +19,10 @@ use rustc_ast::ast::AttrStyle; use rustc_ast::ast::Attribute; use rustc_ast::ast::BareFnTy; use rustc_ast::ast::BinOpKind; -use rustc_ast::ast::BindingAnnotation; +use rustc_ast::ast::BindingMode; use rustc_ast::ast::Block; use rustc_ast::ast::BlockCheckMode; use rustc_ast::ast::BorrowKind; -use rustc_ast::ast::ByRef; use rustc_ast::ast::CaptureBy; use rustc_ast::ast::ClosureBinder; use rustc_ast::ast::Const; @@ -84,7 +82,6 @@ use rustc_ast::ast::Movability; use rustc_ast::ast::MutTy; use rustc_ast::ast::Mutability; use rustc_ast::ast::NodeId; -use rustc_ast::ast::NormalAttr; use rustc_ast::ast::Param; use rustc_ast::ast::ParenthesizedArgs; use rustc_ast::ast::Pat; @@ -130,14 +127,14 @@ use rustc_ast::ast::WhereRegionPredicate; use rustc_ast::ptr::P; use rustc_ast::token::{self, CommentKind, Delimiter, Nonterminal, Token, TokenKind}; use rustc_ast::tokenstream::{ - AttrTokenStream, AttrTokenTree, AttributesData, DelimSpan, LazyAttrTokenStream, Spacing, - TokenStream, TokenTree, + AttrAnnotatedTokenStream, AttrAnnotatedTokenTree, AttributesData, DelimSpan, LazyTokenStream, + Spacing, TokenStream, TokenTree, }; use rustc_data_structures::sync::Lrc; +use rustc_data_structures::thin_vec::ThinVec; use rustc_span::source_map::Spanned; use rustc_span::symbol::{sym, Ident}; use rustc_span::{Span, Symbol, SyntaxContext, DUMMY_SP}; -use thin_vec::ThinVec; pub trait SpanlessEq { fn eq(&self, other: &Self) -> bool; @@ -404,12 +401,11 @@ spanless_eq_struct!(AngleBracketedArgs; span args); spanless_eq_struct!(AnonConst; id value); spanless_eq_struct!(Arm; attrs pat guard body span id is_placeholder); spanless_eq_struct!(AssocConstraint; id ident gen_args kind span); +spanless_eq_struct!(AttrAnnotatedTokenStream; 0); spanless_eq_struct!(AttrItem; path args tokens); -spanless_eq_struct!(AttrTokenStream; 0); spanless_eq_struct!(Attribute; kind id style span); spanless_eq_struct!(AttributesData; attrs tokens); spanless_eq_struct!(BareFnTy; unsafety ext generic_params decl decl_span); -spanless_eq_struct!(BindingAnnotation; 0 1); spanless_eq_struct!(Block; stmts id rules span tokens could_be_bare_literal); spanless_eq_struct!(Crate; attrs items spans id is_placeholder); spanless_eq_struct!(EnumDef; variants); @@ -429,14 +425,13 @@ spanless_eq_struct!(InlineAsmSym; id qself path); spanless_eq_struct!(Item; attrs id span vis ident kind !tokens); spanless_eq_struct!(Label; ident); spanless_eq_struct!(Lifetime; id ident); -spanless_eq_struct!(Lit; token_lit kind span); +spanless_eq_struct!(Lit; token kind span); spanless_eq_struct!(Local; pat ty kind id span attrs !tokens); spanless_eq_struct!(MacCall; path args prior_type_ascription); spanless_eq_struct!(MacCallStmt; mac style attrs tokens); spanless_eq_struct!(MacroDef; body macro_rules); spanless_eq_struct!(ModSpans; !inner_span !inject_use_span); spanless_eq_struct!(MutTy; ty mutbl); -spanless_eq_struct!(NormalAttr; item tokens); spanless_eq_struct!(ParenthesizedArgs; span inputs inputs_span output); spanless_eq_struct!(Pat; id kind span tokens); spanless_eq_struct!(PatField; ident pat is_shorthand attrs id span is_placeholder); @@ -458,19 +453,19 @@ spanless_eq_struct!(Variant; attrs id span !vis ident data disr_expr is_placehol spanless_eq_struct!(Visibility; kind span tokens); spanless_eq_struct!(WhereBoundPredicate; span bound_generic_params bounded_ty bounds); spanless_eq_struct!(WhereClause; has_where_token predicates span); -spanless_eq_struct!(WhereEqPredicate; span lhs_ty rhs_ty); +spanless_eq_struct!(WhereEqPredicate; id span lhs_ty rhs_ty); spanless_eq_struct!(WhereRegionPredicate; span lifetime bounds); spanless_eq_struct!(token::Lit; kind symbol suffix); spanless_eq_enum!(AngleBracketedArg; Arg(0) Constraint(0)); spanless_eq_enum!(AssocItemKind; Const(0 1 2) Fn(0) TyAlias(0) MacCall(0)); spanless_eq_enum!(AssocConstraintKind; Equality(term) Bound(bounds)); spanless_eq_enum!(Async; Yes(span closure_id return_impl_trait_id) No); +spanless_eq_enum!(AttrAnnotatedTokenTree; Token(0) Delimited(0 1 2) Attributes(0)); spanless_eq_enum!(AttrStyle; Outer Inner); -spanless_eq_enum!(AttrTokenTree; Token(0 1) Delimited(0 1 2) Attributes(0)); spanless_eq_enum!(BinOpKind; Add Sub Mul Div Rem And Or BitXor BitAnd BitOr Shl Shr Eq Lt Le Ne Ge Gt); +spanless_eq_enum!(BindingMode; ByRef(0) ByValue(0)); spanless_eq_enum!(BlockCheckMode; Default Unsafe(0)); spanless_eq_enum!(BorrowKind; Ref Raw); -spanless_eq_enum!(ByRef; Yes No); spanless_eq_enum!(CaptureBy; Value Ref); spanless_eq_enum!(ClosureBinder; NotPresent For(span generic_params)); spanless_eq_enum!(Const; Yes(0) No); @@ -507,23 +502,22 @@ spanless_eq_enum!(StructRest; Base(0) Rest(0) None); spanless_eq_enum!(Term; Ty(0) Const(0)); spanless_eq_enum!(TokenTree; Token(0 1) Delimited(0 1 2)); spanless_eq_enum!(TraitBoundModifier; None Maybe MaybeConst MaybeConstMaybe); -spanless_eq_enum!(TraitObjectSyntax; Dyn DynStar None); +spanless_eq_enum!(TraitObjectSyntax; Dyn None); spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128); spanless_eq_enum!(UnOp; Deref Not Neg); spanless_eq_enum!(Unsafe; Yes(0) No); spanless_eq_enum!(UnsafeSource; CompilerGenerated UserProvided); spanless_eq_enum!(UseTreeKind; Simple(0 1 2) Nested(0) Glob); spanless_eq_enum!(VariantData; Struct(0 1) Tuple(0 1) Unit(0)); -spanless_eq_enum!(VisibilityKind; Public Restricted(path id shorthand) Inherited); +spanless_eq_enum!(VisibilityKind; Public Restricted(path id) Inherited); spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredicate(0)); spanless_eq_enum!(ExprKind; Box(0) Array(0) ConstBlock(0) Call(0 1) - MethodCall(0 1 2 3) Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) - Type(0 1) Let(0 1 2) If(0 1 2) While(0 1 2) ForLoop(0 1 2 3) Loop(0 1) - Match(0 1) Closure(0 1 2 3 4 5 6) Block(0 1) Async(0 1 2) Await(0) - TryBlock(0) Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1) Underscore - Range(0 1 2) Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0) - InlineAsm(0) MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) - Yeet(0) Err); + MethodCall(0 1 2) Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) Type(0 1) + Let(0 1 2) If(0 1 2) While(0 1 2) ForLoop(0 1 2 3) Loop(0 1) Match(0 1) + Closure(0 1 2 3 4 5 6) Block(0 1) Async(0 1 2) Await(0) TryBlock(0) + Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1) Underscore Range(0 1 2) + Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0) InlineAsm(0) + MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) Yeet(0) Err); spanless_eq_enum!(InlineAsmOperand; In(reg expr) Out(reg late expr) InOut(reg late expr) SplitInOut(reg late in_expr out_expr) Const(anon_const) Sym(sym)); @@ -531,7 +525,7 @@ spanless_eq_enum!(ItemKind; ExternCrate(0) Use(0) Static(0 1 2) Const(0 1 2) Fn(0) Mod(0 1) ForeignMod(0) GlobalAsm(0) TyAlias(0) Enum(0 1) Struct(0 1) Union(0 1) Trait(0) TraitAlias(0 1) Impl(0) MacCall(0) MacroDef(0)); spanless_eq_enum!(LitKind; Str(0 1) ByteStr(0) Byte(0) Char(0) Int(0 1) - Float(0 1) Bool(0) Err); + Float(0 1) Bool(0) Err(0)); spanless_eq_enum!(PatKind; Wild Ident(0 1 2) Struct(0 1 2 3) TupleStruct(0 1 2) Or(0) Path(0 1) Tuple(0) Box(0) Ref(0 1) Lit(0) Range(0 1 2) Slice(0) Rest Paren(0) MacCall(0)); @@ -697,7 +691,7 @@ fn is_escaped_literal_token(token: &Token, unescaped: Symbol) -> bool { Token { kind: TokenKind::Literal(lit), span: _, - } => match Lit::from_token_lit(*lit, DUMMY_SP) { + } => match Lit::from_lit_token(*lit, DUMMY_SP) { Ok(lit) => is_escaped_literal(&lit, unescaped), Err(_) => false, }, @@ -728,7 +722,7 @@ fn is_escaped_literal_macro_arg(arg: &MacArgsEq, unescaped: Symbol) -> bool { fn is_escaped_literal(lit: &Lit, unescaped: Symbol) -> bool { match lit { Lit { - token_lit: + token: token::Lit { kind: token::LitKind::Str, symbol: _, @@ -741,10 +735,10 @@ fn is_escaped_literal(lit: &Lit, unescaped: Symbol) -> bool { } } -impl SpanlessEq for LazyAttrTokenStream { +impl SpanlessEq for LazyTokenStream { fn eq(&self, other: &Self) -> bool { - let this = self.to_attr_token_stream(); - let other = other.to_attr_token_stream(); + let this = self.create_token_stream(); + let other = other.create_token_stream(); SpanlessEq::eq(&this, &other) } } @@ -752,26 +746,26 @@ impl SpanlessEq for LazyAttrTokenStream { impl SpanlessEq for AttrKind { fn eq(&self, other: &Self) -> bool { match (self, other) { - (AttrKind::Normal(normal), AttrKind::Normal(normal2)) => { - SpanlessEq::eq(normal, normal2) + (AttrKind::Normal(item, tokens), AttrKind::Normal(item2, tokens2)) => { + SpanlessEq::eq(item, item2) && SpanlessEq::eq(tokens, tokens2) } (AttrKind::DocComment(kind, symbol), AttrKind::DocComment(kind2, symbol2)) => { SpanlessEq::eq(kind, kind2) && SpanlessEq::eq(symbol, symbol2) } - (AttrKind::DocComment(kind, unescaped), AttrKind::Normal(normal2)) => { + (AttrKind::DocComment(kind, unescaped), AttrKind::Normal(item2, _tokens)) => { match kind { CommentKind::Line | CommentKind::Block => {} } let path = Path::from_ident(Ident::with_dummy_span(sym::doc)); - SpanlessEq::eq(&path, &normal2.item.path) - && match &normal2.item.args { + SpanlessEq::eq(&path, &item2.path) + && match &item2.args { MacArgs::Empty | MacArgs::Delimited(..) => false, MacArgs::Eq(_span, token) => { is_escaped_literal_macro_arg(token, *unescaped) } } } - (AttrKind::Normal(_), AttrKind::DocComment(..)) => SpanlessEq::eq(other, self), + (AttrKind::Normal(..), AttrKind::DocComment(..)) => SpanlessEq::eq(other, self), } } } diff --git a/bash-5.1/vendor/syn/tests/debug/gen.rs b/bash-5.1/vendor/syn/tests/debug/gen.rs index cfd63d117b0f132af5ac6a01431d429e627d044f..a49ee6c92f77cab75bda2319a938e374456530cc 100644 --- a/bash-5.1/vendor/syn/tests/debug/gen.rs +++ b/bash-5.1/vendor/syn/tests/debug/gen.rs @@ -2215,22 +2215,22 @@ impl Debug for Lite { formatter.write_str(")")?; Ok(()) } - syn::GenericArgument::Const(_val) => { - formatter.write_str("Const")?; + syn::GenericArgument::Binding(_val) => { + formatter.write_str("Binding")?; formatter.write_str("(")?; Debug::fmt(Lite(_val), formatter)?; formatter.write_str(")")?; Ok(()) } - syn::GenericArgument::Binding(_val) => { - formatter.write_str("Binding")?; + syn::GenericArgument::Constraint(_val) => { + formatter.write_str("Constraint")?; formatter.write_str("(")?; Debug::fmt(Lite(_val), formatter)?; formatter.write_str(")")?; Ok(()) } - syn::GenericArgument::Constraint(_val) => { - formatter.write_str("Constraint")?; + syn::GenericArgument::Const(_val) => { + formatter.write_str("Const")?; formatter.write_str("(")?; Debug::fmt(Lite(_val), formatter)?; formatter.write_str(")")?; diff --git a/bash-5.1/vendor/syn/tests/regression/issue1108.rs b/bash-5.1/vendor/syn/tests/regression/issue1108.rs index 4fd30c0c7a84a8caa6411636a2d44ff4fb41fc71..11a82adaadb0e75deb85d3e73a09e627a773f812 100644 --- a/bash-5.1/vendor/syn/tests/regression/issue1108.rs +++ b/bash-5.1/vendor/syn/tests/regression/issue1108.rs @@ -1,5 +1,5 @@ #[test] fn issue1108() { let data = "impl>::x for"; - _ = syn::parse_file(data); + let _ = syn::parse_file(data); } diff --git a/bash-5.1/vendor/syn/tests/repo/mod.rs b/bash-5.1/vendor/syn/tests/repo/mod.rs index 4c7be853bc18617b589c48a6ce35126cc330dc66..0bafe67149701f55873acdbe82eb3b972d24796e 100644 --- a/bash-5.1/vendor/syn/tests/repo/mod.rs +++ b/bash-5.1/vendor/syn/tests/repo/mod.rs @@ -10,10 +10,10 @@ use std::path::Path; use tar::Archive; use walkdir::DirEntry; -const REVISION: &str = "98ad6a5519651af36e246c0335c964dd52c554ba"; +const REVISION: &str = "ee160f2f5e73b6f5954bc33f059c316d9e8582c4"; #[rustfmt::skip] -static EXCLUDE_FILES: &[&str] = &[ +static EXCLUDE: &[&str] = &[ // TODO: impl ~const T {} // https://github.com/dtolnay/syn/issues/1051 "src/test/ui/rfc-2632-const-trait-impl/syntax.rs", @@ -33,21 +33,6 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/rustfmt/tests/source/trait.rs", "src/tools/rustfmt/tests/target/trait.rs", - // Various extensions to Rust syntax made up by rust-analyzer - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0131_existential_type.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0188_const_param_default_path.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0015_use_tree.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0029_range_forms.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0051_parameter_attrs.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0068_item_modifiers.rs", - "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs", - "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs", - "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs", - // Placeholder syntax for "throw expressions" "src/test/pretty/yeet-expr.rs", "src/test/ui/try-trait/yeet-for-option.rs", @@ -56,9 +41,7 @@ static EXCLUDE_FILES: &[&str] = &[ // Excessive nesting "src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs", - // Testing tools on invalid syntax - "src/test/run-make/translation/test.rs", - "src/test/ui/generics/issue-94432-garbage-ice.rs", + // Testing rustfmt on invalid syntax "src/tools/rustfmt/tests/coverage/target/comments.rs", "src/tools/rustfmt/tests/parser/issue-4126/invalid.rs", "src/tools/rustfmt/tests/parser/issue_4418.rs", @@ -71,8 +54,8 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/rustfmt/tests/target/configs/spaces_around_ranges/true.rs", "src/tools/rustfmt/tests/target/type.rs", - // Generated file containing a top-level expression, used with `include!` - "compiler/rustc_codegen_gcc/src/intrinsic/archs.rs", + // Testing compiler diagnostic localization on invalid syntax + "src/test/run-make/translation/basic-translation.rs", // Clippy lint lists represented as expressions "src/tools/clippy/clippy_lints/src/lib.deprecated.rs", @@ -90,6 +73,9 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/clippy/clippy_lints/src/lib.register_suspicious.rs", // Not actually test cases + "src/test/rustdoc-ui/test-compile-fail2.rs", + "src/test/rustdoc-ui/test-compile-fail3.rs", + "src/test/ui/json-bom-plus-crlf-multifile-aux.rs", "src/test/ui/lint/expansion-time-include.rs", "src/test/ui/macros/auxiliary/macro-comma-support.rs", "src/test/ui/macros/auxiliary/macro-include-items-expr.rs", @@ -98,52 +84,38 @@ static EXCLUDE_FILES: &[&str] = &[ "src/test/ui/parser/issues/auxiliary/issue-21146-inc.rs", ]; -#[rustfmt::skip] -static EXCLUDE_DIRS: &[&str] = &[ - // Inputs that intentionally do not parse - "src/tools/rust-analyzer/crates/parser/test_data/parser/err", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err", - - // Inputs that lex but do not necessarily parse - "src/tools/rust-analyzer/crates/parser/test_data/lexer", - - // Inputs that used to crash rust-analyzer, but aren't necessarily supposed to parse - "src/tools/rust-analyzer/crates/syntax/test_data/parser/fuzz-failures", - "src/tools/rust-analyzer/crates/syntax/test_data/reparse/fuzz-failures", -]; - pub fn base_dir_filter(entry: &DirEntry) -> bool { let path = entry.path(); + if path.is_dir() { + return true; // otherwise walkdir does not visit the files + } + if path.extension().map_or(true, |e| e != "rs") { + return false; + } let mut path_string = path.to_string_lossy(); if cfg!(windows) { path_string = path_string.replace('\\', "/").into(); } - let path_string = if path_string == "tests/rust" { - return true; - } else if let Some(path) = path_string.strip_prefix("tests/rust/") { + let path = if let Some(path) = path_string.strip_prefix("tests/rust/") { path } else { panic!("unexpected path in Rust dist: {}", path_string); }; - if path.is_dir() { - return !EXCLUDE_DIRS.contains(&path_string); - } - - if path.extension().map_or(true, |e| e != "rs") { + if path.starts_with("src/test/compile-fail") || path.starts_with("src/test/rustfix") { return false; } - if path_string.starts_with("src/test/ui") || path_string.starts_with("src/test/rustdoc-ui") { - let stderr_path = path.with_extension("stderr"); + if path.starts_with("src/test/ui") { + let stderr_path = entry.path().with_extension("stderr"); if stderr_path.exists() { // Expected to fail in some way return false; } } - !EXCLUDE_FILES.contains(&path_string) + !EXCLUDE.contains(&path) } #[allow(dead_code)] @@ -165,17 +137,10 @@ pub fn clone_rust() { } let mut missing = String::new(); let test_src = Path::new("tests/rust"); - for exclude in EXCLUDE_FILES { - if !test_src.join(exclude).is_file() { - missing += "\ntests/rust/"; - missing += exclude; - } - } - for exclude in EXCLUDE_DIRS { - if !test_src.join(exclude).is_dir() { + for exclude in EXCLUDE { + if !test_src.join(exclude).exists() { missing += "\ntests/rust/"; missing += exclude; - missing += "/"; } } if !missing.is_empty() { diff --git a/bash-5.1/vendor/syn/tests/test_parse_stream.rs b/bash-5.1/vendor/syn/tests/test_parse_stream.rs index cc14fa032e855b8cc24e7fdcb9003eb2b041c442..76bd065777a75b116e4fa757dfb552021c577025 100644 --- a/bash-5.1/vendor/syn/tests/test_parse_stream.rs +++ b/bash-5.1/vendor/syn/tests/test_parse_stream.rs @@ -4,9 +4,9 @@ use syn::{Ident, Token}; #[test] fn test_peek() { - _ = |input: ParseStream| { - _ = input.peek(Ident); - _ = input.peek(Ident::peek_any); - _ = input.peek(Token![::]); + let _ = |input: ParseStream| { + let _ = input.peek(Ident); + let _ = input.peek(Ident::peek_any); + let _ = input.peek(Token![::]); }; } diff --git a/bash-5.1/vendor/syn/tests/test_precedence.rs b/bash-5.1/vendor/syn/tests/test_precedence.rs index dbcd74f16353130b891bbdeb42c53151dc791f59..bd273a5653d65ece7a198ca318695a69da0d67c5 100644 --- a/bash-5.1/vendor/syn/tests/test_precedence.rs +++ b/bash-5.1/vendor/syn/tests/test_precedence.rs @@ -24,7 +24,6 @@ extern crate rustc_ast; extern crate rustc_data_structures; extern crate rustc_span; -extern crate thin_vec; use crate::common::eq::SpanlessEq; use crate::common::parse; @@ -208,10 +207,10 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { }; use rustc_ast::mut_visit::{noop_visit_generic_arg, noop_visit_local, MutVisitor}; use rustc_data_structures::map_in_place::MapInPlace; + use rustc_data_structures::thin_vec::ThinVec; use rustc_span::DUMMY_SP; use std::mem; use std::ops::DerefMut; - use thin_vec::ThinVec; struct BracketsVisitor { failed: bool, @@ -244,7 +243,7 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { } fn noop_visit_expr(e: &mut Expr, vis: &mut T) { - use rustc_ast::mut_visit::{noop_visit_expr, visit_attrs}; + use rustc_ast::mut_visit::{noop_visit_expr, visit_thin_attrs}; match &mut e.kind { ExprKind::AddrOf(BorrowKind::Raw, ..) => {} ExprKind::Struct(expr) => { @@ -262,7 +261,7 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { } vis.visit_id(&mut e.id); vis.visit_span(&mut e.span); - visit_attrs(&mut e.attrs, vis); + visit_thin_attrs(&mut e.attrs, vis); } _ => noop_visit_expr(e, vis), } @@ -323,15 +322,15 @@ fn librustc_brackets(mut librustc_expr: P) -> Option> { // types yet. We'll look into comparing those in the future. For now // focus on expressions appearing in other places. fn visit_pat(&mut self, pat: &mut P) { - _ = pat; + let _ = pat; } fn visit_ty(&mut self, ty: &mut P) { - _ = ty; + let _ = ty; } fn visit_attribute(&mut self, attr: &mut Attribute) { - _ = attr; + let _ = attr; } } @@ -427,7 +426,7 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr { fn collect_exprs(file: syn::File) -> Vec { use syn::fold::Fold; use syn::punctuated::Punctuated; - use syn::{token, ConstParam, Expr, ExprTuple, Path}; + use syn::{token, Expr, ExprTuple, Path}; struct CollectExprs(Vec); impl Fold for CollectExprs { @@ -448,10 +447,6 @@ fn collect_exprs(file: syn::File) -> Vec { // Skip traversing into const generic path arguments path } - - fn fold_const_param(&mut self, const_param: ConstParam) -> ConstParam { - const_param - } } let mut folder = CollectExprs(vec![]); diff --git a/bash-5.1/vendor/syn/tests/test_size.rs b/bash-5.1/vendor/syn/tests/test_size.rs index 02b0700f00be349694c68a2cc0774b7c0944a492..e172df2bc27a032ef0bb1ceb5ba358239dab2bb2 100644 --- a/bash-5.1/vendor/syn/tests/test_size.rs +++ b/bash-5.1/vendor/syn/tests/test_size.rs @@ -5,17 +5,17 @@ use syn::{Expr, Item, Lit, Pat, Type}; #[test] fn test_expr_size() { - assert_eq!(mem::size_of::(), 264); + assert_eq!(mem::size_of::(), 280); } #[test] fn test_item_size() { - assert_eq!(mem::size_of::(), 320); + assert_eq!(mem::size_of::(), 344); } #[test] fn test_type_size() { - assert_eq!(mem::size_of::(), 280); + assert_eq!(mem::size_of::(), 304); } #[test] @@ -25,5 +25,5 @@ fn test_pat_size() { #[test] fn test_lit_size() { - assert_eq!(mem::size_of::(), 32); + assert_eq!(mem::size_of::(), 40); } diff --git a/bash-5.1/vendor/thiserror-impl/.cargo-checksum.json b/bash-5.1/vendor/thiserror-impl/.cargo-checksum.json index e398ffbb524d4689f9ff5f1bb43d548deec105fe..002cf212c8eb491a9c4e52bb18ed94040450bbe5 100644 --- a/bash-5.1/vendor/thiserror-impl/.cargo-checksum.json +++ b/bash-5.1/vendor/thiserror-impl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"af63bbe7a8ec50e29f44aa648a65afd05486852589b467030d28bbd7e0c878f4","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"c7601e8394f5ee304365c520181f0dbeaa807ddaa71ce4a8618ea1a70f81b3b2","src/attr.rs":"d1fe75dde04cb8df6da4e1aaec5b38c2b0f634fa3432877993b3fec4cc08b6b5","src/expand.rs":"8e2bc7ca24e8f8d9b179b792e772d3699154b750a08dcb942be298b7cc032563","src/fmt.rs":"d63d39120c18712596f9f2a1715821148c2becd4d8bad5bc1b307210a84dbe98","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"7d023310cd3db670554ce108a6afd94e1ae3c55c83661d4b9fcebdf1865b9e4b","src/prop.rs":"6709932aee8f9d217f40cd644629c0ecb2f46d333ae8a1398e8d745534f4e028","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"} \ No newline at end of file +{"files":{"Cargo.toml":"3171e8d362ab2f3958292eb1862426b9206637c2941edbc482460f5e0b04c9d0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","src/ast.rs":"c7601e8394f5ee304365c520181f0dbeaa807ddaa71ce4a8618ea1a70f81b3b2","src/attr.rs":"d1fe75dde04cb8df6da4e1aaec5b38c2b0f634fa3432877993b3fec4cc08b6b5","src/expand.rs":"791000b41cc09250c04dbf2f7adc06f1254922986c86633471e934621ce31940","src/fmt.rs":"d63d39120c18712596f9f2a1715821148c2becd4d8bad5bc1b307210a84dbe98","src/generics.rs":"2076cde22271be355a8131a77add4b93f83ab0af4317cd2df5471fffa4f95c66","src/lib.rs":"7d023310cd3db670554ce108a6afd94e1ae3c55c83661d4b9fcebdf1865b9e4b","src/prop.rs":"6709932aee8f9d217f40cd644629c0ecb2f46d333ae8a1398e8d745534f4e028","src/valid.rs":"ac95253944fd360d3578d0643a7baabb2cfa6bf9fbced7a6ce1f7b0529a3bb98"},"package":"c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09"} \ No newline at end of file diff --git a/bash-5.1/vendor/thiserror-impl/Cargo.toml b/bash-5.1/vendor/thiserror-impl/Cargo.toml index 9f832394ee76c7e70df08e8722a8a200e2d82768..c377ae01bd198f904a556f8252b1345120b640d2 100644 --- a/bash-5.1/vendor/thiserror-impl/Cargo.toml +++ b/bash-5.1/vendor/thiserror-impl/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "thiserror-impl" -version = "1.0.37" +version = "1.0.33" authors = ["David Tolnay "] description = "Implementation detail of the `thiserror` crate" license = "MIT OR Apache-2.0" diff --git a/bash-5.1/vendor/thiserror-impl/src/expand.rs b/bash-5.1/vendor/thiserror-impl/src/expand.rs index 43522096a1ed8dfa9b35c3bac2f99d923ef80e51..f2f7116f2b98ea0fd70f867d3f6ed05a06e4b517 100644 --- a/bash-5.1/vendor/thiserror-impl/src/expand.rs +++ b/bash-5.1/vendor/thiserror-impl/src/expand.rs @@ -67,12 +67,12 @@ fn impl_struct(input: Struct) -> TokenStream { let source_provide = if type_is_option(source_field.ty) { quote_spanned! {source.span()=> if let std::option::Option::Some(source) = &self.#source { - source.thiserror_provide(#demand); + source.as_dyn_error().provide(#demand); } } } else { quote_spanned! {source.span()=> - self.#source.thiserror_provide(#demand); + self.#source.as_dyn_error().provide(#demand); } }; let self_provide = if source == backtrace { @@ -89,7 +89,7 @@ fn impl_struct(input: Struct) -> TokenStream { }) }; quote! { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::AsDynError; #source_provide #self_provide } @@ -259,12 +259,12 @@ fn impl_enum(input: Enum) -> TokenStream { let source_provide = if type_is_option(source_field.ty) { quote_spanned! {source.span()=> if let std::option::Option::Some(source) = #varsource { - source.thiserror_provide(#demand); + source.as_dyn_error().provide(#demand); } } } else { quote_spanned! {source.span()=> - #varsource.thiserror_provide(#demand); + #varsource.as_dyn_error().provide(#demand); } }; let self_provide = if type_is_option(backtrace_field.ty) { @@ -284,7 +284,7 @@ fn impl_enum(input: Enum) -> TokenStream { #source: #varsource, .. } => { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::AsDynError; #source_provide #self_provide } @@ -298,17 +298,17 @@ fn impl_enum(input: Enum) -> TokenStream { let source_provide = if type_is_option(source_field.ty) { quote_spanned! {backtrace.span()=> if let std::option::Option::Some(source) = #varsource { - source.thiserror_provide(#demand); + source.as_dyn_error().provide(#demand); } } } else { quote_spanned! {backtrace.span()=> - #varsource.thiserror_provide(#demand); + #varsource.as_dyn_error().provide(#demand); } }; quote! { #ty::#ident {#backtrace: #varsource, ..} => { - use thiserror::__private::ThiserrorProvide; + use thiserror::__private::AsDynError; #source_provide } } diff --git a/bash-5.1/vendor/thiserror/.cargo-checksum.json b/bash-5.1/vendor/thiserror/.cargo-checksum.json index b82148e8fad8780c6e40a41bb6c019c09833cc4f..f62a31345dbf06d2853296d818160fb99fbf9042 100644 --- a/bash-5.1/vendor/thiserror/.cargo-checksum.json +++ b/bash-5.1/vendor/thiserror/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"1d01528e44c86dd86ee07557c6cd89bd3cf37a2456e6f3430af299d84f304035","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"959ac4d4dc43ce39235613d853db8df4a0cfd79e262fc38aba43a98331643952","build.rs":"8b8d9cbf84b9a2fd108b49ecb4bae327da688d80b818acda9ee17170c788e193","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"c93bd9191f26a7599043b397e26822564d9bafaa339a19861182a9909e8a3811","src/display.rs":"63c492bfa8b8e9180ad5abcbe63c1173b4ad490c47ec33cac9a338f96c8f8e42","src/lib.rs":"3fcc3c1ab31a64215978b92e68c1421ec8c5fcb942e57eb35adb9cc07a865730","src/provide.rs":"b2f7a33f44f44a03e94f54cc4b79ba2dcc5fcf0fdf64b07cdd9588a6544c8d8e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"fd1f326bc23e6c1611a51bc43c1d5092b32ee18a1613abe20da0818e5729c0ed","tests/test_deprecated.rs":"7b80a10f090a3982da017556d3d71398abcead59afd8278c7b9d9b1f7b66c7b3","tests/test_display.rs":"20fdc8903f06da3a698ef4377cccca26a71138ca6de67310c5bdb8a9fcb39d83","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"388402702a3be4ffcd0574d66733e8932bf7d5de37544a00ecb0e4f8d8246da4","tests/test_from.rs":"de1347e62069f826d8616b9e45ce6cccc3a8a8049cb51bd22d6763efe6118b0c","tests/test_generics.rs":"4f33747e3f62550d5af94687679af230ef92fbb3247ae4b41df46792a040e4dc","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"3a82af1ad206444b9955e3f2fda508d70f887ad0b7f7986bafc17496f63b07ab","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/from-backtrace-backtrace.rs":"1fd51c5a1f7f6b6ee676d9fc798b6276ef2ce75def33d07f0e4b7bbde3291859","tests/ui/from-backtrace-backtrace.stderr":"f9774e9dad51374501ef4a55fa2dacece4d1c70e29ca18761394bdb80a9a74da","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"40f47b286b770808a7dc5ec7970bc5cd501c9400f2e50049cf3258174929a9c1","tests/ui/source-enum-not-error.rs":"7c57c63b3ec37bc456738acea2e1038de5b0f32fe7e83984037d7ad1ed921737","tests/ui/source-enum-not-error.stderr":"1bb601243ff11d5de08c70edf3fd89d52b4a89fcd2a5c7775d1bc11d056ced1e","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"9a1a04d606309c82eea59d1745c833189f0b4f237f0741a17dd62c11ce16642d","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"} \ No newline at end of file +{"files":{"Cargo.toml":"0de812f611be41d9b1962bdcb235479fed9d9d48eed22033fdb0c2cadbb0e602","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f774d4cb12047fef7c65a86e00eb7299f9250e0bc1aa445d16f63162ec942551","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/aserror.rs":"3dd14cfcfe4a0ab8b1dd774e4ea0a0197989afe84e0687e73873b61cfa4347fa","src/display.rs":"63c492bfa8b8e9180ad5abcbe63c1173b4ad490c47ec33cac9a338f96c8f8e42","src/lib.rs":"62b459b2bf9b53647570511189ed4980a0aed10a9f49abec7c34cef53178a6b2","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test_backtrace.rs":"43323a073ca464b16e213869d3f459f07a0f9601f1516ec81371c825fb1ec8f2","tests/test_display.rs":"20fdc8903f06da3a698ef4377cccca26a71138ca6de67310c5bdb8a9fcb39d83","tests/test_error.rs":"d06dca3c38f22d7ce4e27dadd6c0f78e5cefe3a2ebbc5fe44abc9ddd5ee1985f","tests/test_expr.rs":"388402702a3be4ffcd0574d66733e8932bf7d5de37544a00ecb0e4f8d8246da4","tests/test_from.rs":"de1347e62069f826d8616b9e45ce6cccc3a8a8049cb51bd22d6763efe6118b0c","tests/test_generics.rs":"4f33747e3f62550d5af94687679af230ef92fbb3247ae4b41df46792a040e4dc","tests/test_lints.rs":"c17d79d77edfcdd4b8f6dcdcd1c70ad065cfbc747e1a618ac6343315d0b59ea4","tests/test_option.rs":"3a82af1ad206444b9955e3f2fda508d70f887ad0b7f7986bafc17496f63b07ab","tests/test_path.rs":"ef5452c7e828a0179f5ace7e19f95b9762aa887caf10244adbfe36ded712c090","tests/test_source.rs":"f2f04f11bf8a709eddb1c68f113cda0c2be87e56800d6b9d991bedd545b4642f","tests/test_transparent.rs":"cd8d5be14d00d610a1782104bea6c013618501dab5c3625178ecfcf66e31f939","tests/ui/bad-field-attr.rs":"c5b567e3091969a01061843fb2d95c5e1aa3fa81edfeecdf416a84a6fba40aa8","tests/ui/bad-field-attr.stderr":"78f576d5ec66464a77f1cdf0f5bb7dcdf18f7f04f1165983a6239ec59d908ea3","tests/ui/concat-display.rs":"3995bd6b3bdd67df7bb16499775d89600c0dd20895633fe807396a64c117078d","tests/ui/concat-display.stderr":"256dfde61ee689ebe51588b135e2e030bdf95ba5adef1cb59f588c797bbdeef2","tests/ui/duplicate-enum-source.rs":"bfe28ce18042d446a76c7411aa233598211ce1157fdd3cb87bff3b3fa7c33131","tests/ui/duplicate-enum-source.stderr":"3d32fead420b27b4497be49080bc3b78f7f0ba339ead3de6c94e5dc20302c18f","tests/ui/duplicate-fmt.rs":"af53b66445bcce076a114376747f176b42c060a156563a41ccb638ae14c451fd","tests/ui/duplicate-fmt.stderr":"998bb121ce6f1595fd99529a7a1b06451b6bf476924337dce5524a83a7a5f1a1","tests/ui/duplicate-struct-source.rs":"f3d5f8e3d6fccfcdbb630db291353709583a920c6bf46f9f9de9966b67ea4c0f","tests/ui/duplicate-struct-source.stderr":"fb761d76668ac42357cf37b03c0abdbae5de0a828034990850291c9cb6ab766d","tests/ui/duplicate-transparent.rs":"41a9447e85f1a47027023442acde55c3d8610ec46d91b39bd43a42d7a004d747","tests/ui/duplicate-transparent.stderr":"4975abad43e973df158f18098d9bcb9dc39f8e75d3e733ed5d6620d1ee065c11","tests/ui/from-backtrace-backtrace.rs":"1fd51c5a1f7f6b6ee676d9fc798b6276ef2ce75def33d07f0e4b7bbde3291859","tests/ui/from-backtrace-backtrace.stderr":"f9774e9dad51374501ef4a55fa2dacece4d1c70e29ca18761394bdb80a9a74da","tests/ui/from-not-source.rs":"744a55aeffe11066830159ac023c33aaa5576e313b341fa24440ee13dfe3ac98","tests/ui/from-not-source.stderr":"525038e8b841707b927434cca4549168f73bd305faca17552a0d1fffa542ccc4","tests/ui/lifetime.rs":"e72e0391695e47fcd07edbf3819f114e468e2097086ec687781c7c8d6b4b7da7","tests/ui/lifetime.stderr":"d889a23f71324afe95dafc5f9d15337fbdbc9977cb8924f0cafe3a3becf4ced7","tests/ui/missing-fmt.rs":"bc9e2830e54c2474ff6c27a766ed3dee88d29e40f93f30e8d64d63233866c17d","tests/ui/missing-fmt.stderr":"9a20ccee9b660fe31a5b3199307b48580bb8305cb9ce33d97d3fc767a0cfc614","tests/ui/no-display.rs":"962245372272d23e9833311c15e73221b3c7da822a2ff90189613af56ffb5c2e","tests/ui/no-display.stderr":"40f47b286b770808a7dc5ec7970bc5cd501c9400f2e50049cf3258174929a9c1","tests/ui/source-enum-not-error.rs":"7c57c63b3ec37bc456738acea2e1038de5b0f32fe7e83984037d7ad1ed921737","tests/ui/source-enum-not-error.stderr":"44c974bf0b87431af78ccc7b4e18ebdc45135ca584a254960dff3f908ed862a8","tests/ui/source-struct-not-error.rs":"09fb7713637242dca9192585a6daeb8d732dc1c1d0fa522b74f1c98618e6d949","tests/ui/source-struct-not-error.stderr":"8e087a059c6b69de44e149ab3b5bffc4f4c6c3cbbb13c235c9a3c7c264be3245","tests/ui/transparent-display.rs":"b3c59583eb64b0b5a246444456d03cf52d51bcdc08885023600dbb44fd87e5f2","tests/ui/transparent-display.stderr":"16d538914e0d92026bde4b4bec75660217da9ecc6b621d12d2eb81d33ed1d1da","tests/ui/transparent-enum-many.rs":"2a40a764fb4683bff57973eec61507a6c00f7d4d7a32da6e7bd0190c2e445434","tests/ui/transparent-enum-many.stderr":"f1d78c1d6d8edbef153420db4fb9ca3dc6076fa043b5b1bc0cd291daa417a3ea","tests/ui/transparent-enum-source.rs":"18f606a98ac0a53f08dc56f5f923b9cbe75d25ed34479c777b48dac305d5968c","tests/ui/transparent-enum-source.stderr":"1b2e0ac53951034575d43ec0396c4e2b3cfb272db2aef8d6baa13a7e1632cc84","tests/ui/transparent-struct-many.rs":"72c6b6c1a44c203d3bc68989b2f1ec092531ef75b745432824c3776c290326f6","tests/ui/transparent-struct-many.stderr":"7bd0536dbb54a0ce7d4a8e66ca7624a1b132d8a1d1e4fecca642ec77494ac01c","tests/ui/transparent-struct-source.rs":"863fa691ed7d27e8767da58d9ee11fd40d6642274b36338ca1074c07964ea2b3","tests/ui/transparent-struct-source.stderr":"267dab65929e67d32347fb467a00b43af931f8205d727d7671938580217fc70e","tests/ui/unexpected-field-fmt.rs":"29fba7b4d81c642ec8e47cfe053aa515acf9080a86d65e685363a48993becfe3","tests/ui/unexpected-field-fmt.stderr":"20731c4a08af04bed3ff513903adadd690b6bc532b15604557e7f25575a8338f","tests/ui/unexpected-struct-source.rs":"c6cbe882d622635c216feb8290b1bd536ce0ec4feee16bc087667a21b3641d5c","tests/ui/unexpected-struct-source.stderr":"7c8227513478f6cc09e8a28be337c8a0e758a06ca5978d774c91bd43c4a54043","tests/ui/union.rs":"331adff27cebd8b95b03b6742cc8247331fda1f961e1590ed39c8d39f50cf1d8","tests/ui/union.stderr":"5f67ad29753d6fb14bc03aef7d4a1f660ee7796e469c037efbf8b13456934ad3"},"package":"3d0a539a918745651435ac7db7a18761589a94cd7e94cd56999f828bf73c8a57"} \ No newline at end of file diff --git a/bash-5.1/vendor/thiserror/Cargo.toml b/bash-5.1/vendor/thiserror/Cargo.toml index 2f060d6d8f4a8cb7717c5efe0d81bbb40cbfd4b9..5926572e30bbd33e5751e62f841fea6e6a509eeb 100644 --- a/bash-5.1/vendor/thiserror/Cargo.toml +++ b/bash-5.1/vendor/thiserror/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "thiserror" -version = "1.0.37" +version = "1.0.33" authors = ["David Tolnay "] description = "derive(Error)" documentation = "https://docs.rs/thiserror" @@ -31,10 +31,10 @@ repository = "https://github.com/dtolnay/thiserror" targets = ["x86_64-unknown-linux-gnu"] [dependencies.thiserror-impl] -version = "=1.0.37" +version = "=1.0.33" [dev-dependencies.anyhow] -version = "1.0.65" +version = "1.0" [dev-dependencies.ref-cast] version = "1.0" diff --git a/bash-5.1/vendor/thiserror/README.md b/bash-5.1/vendor/thiserror/README.md index 8f6b896debf367f199e4838b6abc6ed6978867cc..387a56e468a2fd9fd3ab3416cb47a73534e36ae9 100644 --- a/bash-5.1/vendor/thiserror/README.md +++ b/bash-5.1/vendor/thiserror/README.md @@ -124,8 +124,8 @@ pub enum DataStoreError { } ``` -- The Error trait's `provide()` method is implemented to provide whichever field - has a type named `Backtrace`, if any, as a `std::backtrace::Backtrace`. +- The Error trait's `backtrace()` method is implemented to return whichever + field has a type named `Backtrace`, if any. ```rust use std::backtrace::Backtrace; @@ -138,9 +138,8 @@ pub enum DataStoreError { ``` - If a field is both a source (named `source`, or has `#[source]` or `#[from]` - attribute) *and* is marked `#[backtrace]`, then the Error trait's `provide()` - method is forwarded to the source's `provide` so that both layers of the error - share the same backtrace. + attribute) *and* is marked `#[backtrace]`, then the Error trait's + `backtrace()` method is forwarded to the source's backtrace. ```rust #[derive(Error, Debug)] @@ -166,27 +165,6 @@ pub enum DataStoreError { } ``` - Another use case is hiding implementation details of an error representation - behind an opaque error type, so that the representation is able to evolve - without breaking the crate's public API. - - ```rust - // PublicError is public, but opaque and easy to keep compatible. - #[derive(Error, Debug)] - #[error(transparent)] - pub struct PublicError(#[from] ErrorRepr); - - impl PublicError { - // Accessors for anything we do want to expose publicly. - } - - // Private and free to change across minor version of the crate. - #[derive(Error, Debug)] - enum ErrorRepr { - ... - } - ``` - - See also the [`anyhow`] library for a convenient single error type to use in application code. diff --git a/bash-5.1/vendor/thiserror/src/aserror.rs b/bash-5.1/vendor/thiserror/src/aserror.rs index 5fea84ef885ddc48b55e059f165762cecdbc5a58..c036b7b09d2969ce507d9bf84a2d0dcae44ab3cc 100644 --- a/bash-5.1/vendor/thiserror/src/aserror.rs +++ b/bash-5.1/vendor/thiserror/src/aserror.rs @@ -1,7 +1,7 @@ use std::error::Error; use std::panic::UnwindSafe; -pub trait AsDynError<'a>: Sealed { +pub trait AsDynError<'a> { fn as_dyn_error(&self) -> &(dyn Error + 'a); } @@ -39,10 +39,3 @@ impl<'a> AsDynError<'a> for dyn Error + Send + Sync + UnwindSafe + 'a { self } } - -pub trait Sealed {} -impl<'a, T: Error + 'a> Sealed for T {} -impl<'a> Sealed for dyn Error + 'a {} -impl<'a> Sealed for dyn Error + Send + 'a {} -impl<'a> Sealed for dyn Error + Send + Sync + 'a {} -impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {} diff --git a/bash-5.1/vendor/thiserror/src/lib.rs b/bash-5.1/vendor/thiserror/src/lib.rs index aae6552d091dfde2178da64352f564587219b387..247199ffd0aaf1ffba33ffb6e96eadbef7598b15 100644 --- a/bash-5.1/vendor/thiserror/src/lib.rs +++ b/bash-5.1/vendor/thiserror/src/lib.rs @@ -146,9 +146,8 @@ //! # } //! ``` //! -//! - The Error trait's `provide()` method is implemented to provide whichever -//! field has a type named `Backtrace`, if any, as a -//! `std::backtrace::Backtrace`. +//! - The Error trait's `backtrace()` method is implemented to return whichever +//! field has a type named `Backtrace`, if any. //! //! ```rust //! # const IGNORE: &str = stringify! { @@ -164,8 +163,7 @@ //! //! - If a field is both a source (named `source`, or has `#[source]` or //! `#[from]` attribute) *and* is marked `#[backtrace]`, then the Error -//! trait's `provide()` method is forwarded to the source's `provide` so that -//! both layers of the error share the same backtrace. +//! trait's `backtrace()` method is forwarded to the source's backtrace. //! //! ```rust //! # const IGNORE: &str = stringify! { @@ -198,31 +196,6 @@ //! } //! ``` //! -//! Another use case is hiding implementation details of an error -//! representation behind an opaque error type, so that the representation is -//! able to evolve without breaking the crate's public API. -//! -//! ``` -//! # use thiserror::Error; -//! # -//! // PublicError is public, but opaque and easy to keep compatible. -//! #[derive(Error, Debug)] -//! #[error(transparent)] -//! pub struct PublicError(#[from] ErrorRepr); -//! -//! impl PublicError { -//! // Accessors for anything we do want to expose publicly. -//! } -//! -//! // Private and free to change across minor version of the crate. -//! #[derive(Error, Debug)] -//! enum ErrorRepr { -//! # /* -//! ... -//! # */ -//! } -//! ``` -//! //! - See also the [`anyhow`] library for a convenient single error type to use //! in application code. //! @@ -233,14 +206,10 @@ clippy::doc_markdown, clippy::module_name_repetitions, clippy::return_self_not_must_use, - clippy::wildcard_imports, )] -#![cfg_attr(provide_any, feature(provide_any))] mod aserror; mod display; -#[cfg(provide_any)] -mod provide; pub use thiserror_impl::*; @@ -249,6 +218,4 @@ pub use thiserror_impl::*; pub mod __private { pub use crate::aserror::AsDynError; pub use crate::display::{DisplayAsDisplay, PathAsDisplay}; - #[cfg(provide_any)] - pub use crate::provide::ThiserrorProvide; } diff --git a/bash-5.1/vendor/thiserror/tests/test_backtrace.rs b/bash-5.1/vendor/thiserror/tests/test_backtrace.rs index 43f68b8b7e54b84b9b342731ca2b834c1247aa77..052c6f481440f55a45a4896c3afc1d27018b55d3 100644 --- a/bash-5.1/vendor/thiserror/tests/test_backtrace.rs +++ b/bash-5.1/vendor/thiserror/tests/test_backtrace.rs @@ -21,7 +21,6 @@ pub mod structs { use super::{Inner, InnerBacktrace}; use std::any; use std::backtrace::Backtrace; - use std::error::Error; use std::sync::Arc; use thiserror::Error; @@ -87,20 +86,6 @@ pub mod structs { backtrace: Arc, } - #[derive(Error, Debug)] - #[error("...")] - pub struct AnyhowBacktrace { - #[backtrace] - source: anyhow::Error, - } - - #[derive(Error, Debug)] - #[error("...")] - pub struct BoxDynErrorBacktrace { - #[backtrace] - source: Box, - } - #[test] fn test_backtrace() { let error = PlainBacktrace { @@ -136,37 +121,6 @@ pub mod structs { let error = ArcBacktraceFrom::from(Inner); assert!(any::request_ref::(&error).is_some()); - - let error = AnyhowBacktrace { - source: anyhow::Error::msg("..."), - }; - assert!(any::request_ref::(&error).is_some()); - - let error = BoxDynErrorBacktrace { - source: Box::new(PlainBacktrace { - backtrace: Backtrace::capture(), - }), - }; - assert!(any::request_ref::(&error).is_some()); - } - - // https://github.com/dtolnay/thiserror/issues/185 -- std::error::Error and - // std::any::Provide both have a method called 'provide', so directly - // calling it from generated code could be ambiguous. - #[test] - fn test_provide_name_collision() { - use std::any::Provider; - - #[derive(Error, Debug)] - #[error("...")] - struct MyError { - #[source] - #[backtrace] - x: std::io::Error, - } - - let _: dyn Error; - let _: dyn Provider; } } diff --git a/bash-5.1/vendor/thiserror/tests/ui/source-enum-not-error.stderr b/bash-5.1/vendor/thiserror/tests/ui/source-enum-not-error.stderr index 29ee54600ac0213cccfcab6a251f35c76d69d7f8..da10c6e7700dbcd09b6011171de8ef2bf9756833 100644 --- a/bash-5.1/vendor/thiserror/tests/ui/source-enum-not-error.stderr +++ b/bash-5.1/vendor/thiserror/tests/ui/source-enum-not-error.stderr @@ -4,7 +4,7 @@ error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but it 4 | pub struct NotError; | ------------------- | | - | doesn't satisfy `NotError: AsDynError<'_>` + | doesn't satisfy `NotError: AsDynError` | doesn't satisfy `NotError: std::error::Error` ... 10 | source: NotError, @@ -12,9 +12,9 @@ error[E0599]: the method `as_dyn_error` exists for reference `&NotError`, but it | = note: the following trait bounds were not satisfied: `NotError: std::error::Error` - which is required by `NotError: AsDynError<'_>` + which is required by `NotError: AsDynError` `&NotError: std::error::Error` - which is required by `&NotError: AsDynError<'_>` + which is required by `&NotError: AsDynError` note: the following trait must be implemented --> $RUST/core/src/error.rs | diff --git a/bash-5.1/vendor/thiserror/tests/ui/source-struct-not-error.stderr b/bash-5.1/vendor/thiserror/tests/ui/source-struct-not-error.stderr index efa40281d1baf864e33bdaae65b38981d8ac1b06..cc0e67aca9c7ff0156a2123245db31e62f10482a 100644 --- a/bash-5.1/vendor/thiserror/tests/ui/source-struct-not-error.stderr +++ b/bash-5.1/vendor/thiserror/tests/ui/source-struct-not-error.stderr @@ -5,7 +5,7 @@ error[E0599]: the method `as_dyn_error` exists for struct `NotError`, but its tr | --------------- | | | method `as_dyn_error` not found for this struct - | doesn't satisfy `NotError: AsDynError<'_>` + | doesn't satisfy `NotError: AsDynError` | doesn't satisfy `NotError: std::error::Error` ... 9 | source: NotError, @@ -13,7 +13,7 @@ error[E0599]: the method `as_dyn_error` exists for struct `NotError`, but its tr | = note: the following trait bounds were not satisfied: `NotError: std::error::Error` - which is required by `NotError: AsDynError<'_>` + which is required by `NotError: AsDynError` note: the following trait must be implemented --> $RUST/core/src/error.rs | diff --git a/bash-5.1/vendor/unicode-ident/.cargo-checksum.json b/bash-5.1/vendor/unicode-ident/.cargo-checksum.json index 1fcb95c863fc02401f0f09bbb95427c836bd574e..71995a900d5cbc230c618c05566ae727f1889a20 100644 --- a/bash-5.1/vendor/unicode-ident/.cargo-checksum.json +++ b/bash-5.1/vendor/unicode-ident/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"4589e7f695ce2ae3c0dbb7a79647d044b8f2ef71183bf478fe01922966c54556","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844","README.md":"3dc1793fcaf87c77c5ed467c4a76cb696883f2f4329c011a869fbd34c4404382","benches/xid.rs":"a61f61ecc7d5124c759cdeb55ab74470ab69f2f3ca37613da65f16e0e5e33487","src/lib.rs":"d0030259a628125669ad6c02d3eb791526e6d6ae35d8a858a87f90245162666c","src/tables.rs":"4a84cc7a1a391abebe5672db993c519b9f8fe462690d7e5a8bdd43be8481c10b","tests/compare.rs":"89c4dc4f745064a9f734667b1d960596a10b8cb019a8ed1c5b9512678a866ad5","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"0624500413ac318fee8424eecdad70397f911e3beae52231bfca295bb1bb9e04","tests/fst/xid_start.fst":"cc36f4f1149a4004ea7e2075cfb54756328b571946fda526be508cf5ed53dbdb","tests/roaring/mod.rs":"784f65a48477fab7549620c7843c7ad6da533f69a18abca1172f6acb95045e53","tests/static_size.rs":"6686edc08a6718cb4be03916b87a2594a2d2f2c779dbac6372fd27d5d7f7d8b6","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"dbd7de5fe601159643a4c6febed06793f812e8d71010b0ec78f2557353a976b2"},"package":"6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"} \ No newline at end of file +{"files":{"Cargo.toml":"9f1a0934313101d94964bdcf532bb746fb5d58c696d0dc37e9cf344500a13552","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"68f5b9f5ea36881a0942ba02f558e9e1faf76cc09cb165ad801744c61b738844","README.md":"2dca6b25b21944fa91134d6de872e74836074afab663924b06d33d168cc59e23","benches/xid.rs":"a61f61ecc7d5124c759cdeb55ab74470ab69f2f3ca37613da65f16e0e5e33487","src/lib.rs":"d0030259a628125669ad6c02d3eb791526e6d6ae35d8a858a87f90245162666c","src/tables.rs":"887457a7ce0d2fff750b40134de684e86d3999e5d191544f31ee45936b7bcb72","tests/compare.rs":"89c4dc4f745064a9f734667b1d960596a10b8cb019a8ed1c5b9512678a866ad5","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"6e079a81175e445461dc330f61294c9f24bdb1681b7a591999fbb4547766ea99","tests/fst/xid_start.fst":"382fc736b472d09052a53c89cc2060bd839792350c6d22638b91e9123bf14540","tests/roaring/mod.rs":"784f65a48477fab7549620c7843c7ad6da533f69a18abca1172f6acb95045e53","tests/static_size.rs":"3974f6948c06d60b63738ddf5688478144718da87ccfdc4af6918d76a0bd9f06","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"6780e33f74f86131aa32f321bc3c77c4d9b526b708e82db64b198dce4c86429b"},"package":"c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"} \ No newline at end of file diff --git a/bash-5.1/vendor/unicode-ident/Cargo.toml b/bash-5.1/vendor/unicode-ident/Cargo.toml index 03e1871fc867b5c756127f5912aa2274a44fa7ae..d946cc88742d7e8fea61451bcfe0313cfd566abc 100644 --- a/bash-5.1/vendor/unicode-ident/Cargo.toml +++ b/bash-5.1/vendor/unicode-ident/Cargo.toml @@ -13,15 +13,12 @@ edition = "2018" rust-version = "1.31" name = "unicode-ident" -version = "1.0.5" +version = "1.0.3" authors = ["David Tolnay "] description = "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31" documentation = "https://docs.rs/unicode-ident" readme = "README.md" -keywords = [ - "unicode", - "xid", -] +keywords = ["unicode"] categories = [ "development-tools::procedural-macro-helpers", "no-std", @@ -37,7 +34,7 @@ name = "xid" harness = false [dev-dependencies.criterion] -version = "0.4" +version = "0.3" default-features = false [dev-dependencies.fst] @@ -48,11 +45,11 @@ version = "0.8" features = ["small_rng"] [dev-dependencies.roaring] -version = "0.10" +version = "0.9" [dev-dependencies.ucd-trie] version = "0.1" default-features = false [dev-dependencies.unicode-xid] -version = "0.2.4" +version = "0.2" diff --git a/bash-5.1/vendor/unicode-ident/README.md b/bash-5.1/vendor/unicode-ident/README.md index 6c590b06cd3c49a3565290acbefca4f557dcc555..5a63c61354dcf3557dd83aebbadb67236ab9b302 100644 --- a/bash-5.1/vendor/unicode-ident/README.md +++ b/bash-5.1/vendor/unicode-ident/README.md @@ -41,10 +41,10 @@ different ratios of ASCII to non-ASCII codepoints in the input data. | | static storage | 0% nonascii | 1% | 10% | 100% nonascii | |---|---|---|---|---|---| -| **`unicode-ident`** | 10.0 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns | -| **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns | -| **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns | -| **`fst`** | 138 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns | +| **`unicode-ident`** | 9.75 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns | +| **`unicode-xid`** | 11.34 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns | +| **`ucd-trie`** | 9.95 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns | +| **`fst`** | 133 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns | | **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 ns | Source code for the benchmark is provided in the *bench* directory of this repo diff --git a/bash-5.1/vendor/unicode-ident/src/tables.rs b/bash-5.1/vendor/unicode-ident/src/tables.rs index 380c798d184afc08f410d613dd28c0413180a59c..a697636b6de303a1c5029490bc31ecce31229ce4 100644 --- a/bash-5.1/vendor/unicode-ident/src/tables.rs +++ b/bash-5.1/vendor/unicode-ident/src/tables.rs @@ -28,7 +28,7 @@ pub(crate) static ASCII_CONTINUE: Align64<[bool; 128]> = Align64([ pub(crate) const CHUNK: usize = 64; -pub(crate) static TRIE_START: Align8<[u8; 402]> = Align8([ +pub(crate) static TRIE_START: Align8<[u8; 394]> = Align8([ 0x04, 0x0B, 0x0F, 0x13, 0x17, 0x1B, 0x1F, 0x23, 0x27, 0x2D, 0x31, 0x34, 0x38, 0x3C, 0x40, 0x02, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x4D, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, @@ -39,22 +39,21 @@ pub(crate) static TRIE_START: Align8<[u8; 402]> = Align8([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x60, 0x64, 0x66, 0x6A, 0x6E, 0x72, 0x28, 0x76, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C, 0x90, 0x94, 0x98, 0x9E, 0xA2, 0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0xB1, 0x00, 0xB5, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC8, 0x00, 0x00, 0x00, 0xAF, - 0xCE, 0xD2, 0xD6, 0xBC, 0xDA, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x05, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0xAE, 0x00, 0xB2, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xB8, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xC6, 0x00, 0x00, 0x00, 0xB9, + 0xBC, 0xCF, 0x00, 0xBF, 0xD3, 0x00, 0x00, 0xD7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xE9, 0x00, 0x00, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0xE7, + 0x05, 0x05, 0x05, 0xD9, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xDC, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xDF, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xE1, 0x00, 0x00, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xDD, ]); pub(crate) static TRIE_CONTINUE: Align8<[u8; 1793]> = Align8([ @@ -67,23 +66,23 @@ pub(crate) static TRIE_CONTINUE: Align8<[u8; 1793]> = Align8([ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62, 0x64, 0x68, 0x6C, 0x70, 0x74, 0x28, 0x76, 0x7A, 0x7E, 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9B, 0xA0, 0xA4, - 0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0xB3, 0x00, 0xB7, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0xAC, 0xC4, 0xC6, 0xCA, 0x00, 0xCC, 0x00, 0xAF, - 0xD0, 0xD4, 0xD8, 0xBC, 0xDC, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, + 0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x05, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0xB0, 0x00, 0xB4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xB8, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0xAC, 0xC1, 0xC4, 0xC8, 0x00, 0xCA, 0x00, 0xB9, + 0xCD, 0xD1, 0x00, 0xBF, 0xD5, 0x00, 0x00, 0xD7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xE9, 0x00, 0x00, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x05, 0x05, 0xD9, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xDC, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xDF, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xE1, 0x00, 0x00, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -170,10 +169,10 @@ pub(crate) static TRIE_CONTINUE: Align8<[u8; 1793]> = Align8([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xC2, + 0xCB, ]); -pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ +pub(crate) static LEAF: Align64<[u8; 7264]> = Align64([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -241,7 +240,7 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xF0, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x27, 0x00, 0x40, 0x70, 0x80, 0x03, 0x00, 0x00, 0xFC, 0xE0, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFF, 0xF3, 0xDF, 0x3D, 0x60, 0x27, 0xCF, 0xFF, 0x00, 0x00, - 0xEF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0xF3, 0xDF, 0x3D, 0x60, 0x60, 0xCF, 0xFF, 0x0E, 0x00, + 0xEF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0xF3, 0xDF, 0x3D, 0x60, 0x60, 0xCF, 0xFF, 0x06, 0x00, 0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x7D, 0xF0, 0x80, 0xCF, 0xFF, 0x00, 0xFC, 0xEE, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x84, 0x5F, 0xFF, 0xC0, 0xFF, 0x0C, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -249,7 +248,7 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, - 0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0x3F, 0x5F, 0x7F, 0xFF, 0xF3, 0x00, 0x00, 0x00, 0x00, + 0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0x3F, 0x5F, 0x3F, 0xFF, 0xF3, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xFF, 0x03, 0xA0, 0xC2, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF, 0xDF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x80, 0x00, 0x00, 0x3F, 0x3C, 0x62, 0xC0, 0xE1, 0xFF, @@ -310,7 +309,7 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0x00, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0xF0, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -340,7 +339,7 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0x00, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, @@ -435,7 +434,7 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, @@ -446,11 +445,11 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xDE, 0xFF, 0x17, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x01, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xEF, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0xFB, 0x9F, 0x39, 0x81, 0xE0, 0xCF, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -500,34 +499,28 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0x7F, 0xFB, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x07, 0x00, - 0xF4, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00, - 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0x07, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE3, 0x07, 0xF8, 0xE7, 0x0F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0x7F, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xE0, @@ -552,24 +545,26 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x6F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xFF, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x3F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xFF, 0x01, 0xFF, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x6F, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x64, 0xDE, 0xFF, 0xEB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xE7, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0x7B, 0x5F, 0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -586,12 +581,10 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0x10, 0x00, 0x00, 0xF8, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x3F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x7F, 0xFF, 0xFF, 0xF9, 0xDB, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7F, 0xFF, 0xFF, 0xF9, 0xDB, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, - 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0x3F, 0xFF, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -602,14 +595,6 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -632,14 +617,12 @@ pub(crate) static LEAF: Align64<[u8; 7520]> = Align64([ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/bash-5.1/vendor/unicode-ident/tests/fst/xid_continue.fst b/bash-5.1/vendor/unicode-ident/tests/fst/xid_continue.fst index 05e7b1aa2ff308b57fb409c70c521b4575cba311..5359051cb82edee8fd3faa8cfad6c1663f513ec0 100644 Binary files a/bash-5.1/vendor/unicode-ident/tests/fst/xid_continue.fst and b/bash-5.1/vendor/unicode-ident/tests/fst/xid_continue.fst differ diff --git a/bash-5.1/vendor/unicode-ident/tests/fst/xid_start.fst b/bash-5.1/vendor/unicode-ident/tests/fst/xid_start.fst index a5975b67e57e82eddf216bdb249e32fc1c58c440..5c2e43fac225796496df1a373f9334e204da6cf1 100644 Binary files a/bash-5.1/vendor/unicode-ident/tests/fst/xid_start.fst and b/bash-5.1/vendor/unicode-ident/tests/fst/xid_start.fst differ diff --git a/bash-5.1/vendor/unicode-ident/tests/static_size.rs b/bash-5.1/vendor/unicode-ident/tests/static_size.rs index df65f45dd5e23dae8e18dc220043790b0d2e32a8..f0e04d4db66e28f6d2a1cb4b7dffec8c07d824ed 100644 --- a/bash-5.1/vendor/unicode-ident/tests/static_size.rs +++ b/bash-5.1/vendor/unicode-ident/tests/static_size.rs @@ -13,7 +13,7 @@ fn test_size() { + size_of_val(&tables::TRIE_START) + size_of_val(&tables::TRIE_CONTINUE) + size_of_val(&tables::LEAF); - assert_eq!(10016, size); + assert_eq!(9752, size); } #[test] @@ -24,7 +24,7 @@ fn test_xid_size() { mod ucd; let size = size_of_val(ucd::XID_START) + size_of_val(ucd::XID_CONTINUE); - assert_eq!(11528, size); + assert_eq!(11344, size); let _ = ucd::BY_NAME; } @@ -71,7 +71,7 @@ fn test_trieset_size() { + size_of_val(tree3_level2) + size_of_val(tree3_level3); - assert_eq!(10208, start_size + continue_size); + assert_eq!(9952, start_size + continue_size); let _ = trie::BY_NAME; } @@ -81,7 +81,7 @@ fn test_fst_size() { let xid_start_fst = include_bytes!("fst/xid_start.fst"); let xid_continue_fst = include_bytes!("fst/xid_continue.fst"); let size = xid_start_fst.len() + xid_continue_fst.len(); - assert_eq!(137749, size); + assert_eq!(132897, size); } #[test] diff --git a/bash-5.1/vendor/unicode-ident/tests/trie/trie.rs b/bash-5.1/vendor/unicode-ident/tests/trie/trie.rs index 821e7cb0fcabfee2e3ebabb0222f508b00e2a28b..7f7a14f314dbbaa1428497abe17051fd4d1a626e 100644 --- a/bash-5.1/vendor/unicode-ident/tests/trie/trie.rs +++ b/bash-5.1/vendor/unicode-ident/tests/trie/trie.rs @@ -2,9 +2,9 @@ // // ucd-generate property-bool UCD --include XID_Start,XID_Continue --trie-set // -// Unicode version: 15.0.0. +// Unicode version: 14.0.0. // -// ucd-generate 0.2.13 is available on crates.io. +// ucd-generate 0.2.10 is available on crates.io. pub const BY_NAME: &'static [(&'static str, &'static ::ucd_trie::TrieSet)] = &[ ("XID_Continue", XID_CONTINUE), ("XID_Start", XID_START), @@ -77,10 +77,10 @@ pub const XID_CONTINUE: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { 0xF3C5FDFFFFF99FEF, 0x5003FFCFB080799F, 0xD36DFDFFFFF987EE, 0x3FFFC05E023987, 0xF3EDFDFFFFFBBFEE, 0xFE00FFCF00013BBF, 0xF3EDFDFFFFF99FEE, 0x2FFCFB0E0399F, 0xC3FFC718D63DC7EC, 0xFFC000813DC7, - 0xF3FFFDFFFFFDDFFF, 0xFFCF27603DDF, 0xF3EFFDFFFFFDDFEF, 0xEFFCF60603DDF, + 0xF3FFFDFFFFFDDFFF, 0xFFCF27603DDF, 0xF3EFFDFFFFFDDFEF, 0x6FFCF60603DDF, 0xFFFFFFFFFFFDDFFF, 0xFC00FFCF80F07DDF, 0x2FFBFFFFFC7FFFEE, 0xCFFC0FF5F847F, 0x7FFFFFFFFFFFFFE, 0x3FF7FFF, 0x3FFFFFAFFFFFF7D6, - 0xF3FF7F5F, 0xC2A003FF03000001, 0xFFFE1FFFFFFFFEFF, 0x1FFFFFFFFEFFFFDF, + 0xF3FF3F5F, 0xC2A003FF03000001, 0xFFFE1FFFFFFFFEFF, 0x1FFFFFFFFEFFFFDF, 0x40, 0xFFFFFFFFFFFF03FF, 0xFFFFFFFF3FFFFFFF, 0xF7FFFFFFFFFF20BF, 0xFFFFFFFF3D7F3DFF, 0x7F3DFFFFFFFF3DFF, 0xFFFFFFFFFF7FFF3D, 0xFFFFFFFFFF3DFFFF, 0x3FE00E7FFFFFF, 0xFFFFFFFF0000FFFF, @@ -112,80 +112,78 @@ pub const XID_CONTINUE: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { ], tree3_level1: &[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 5, 9, 10, 11, 12, 13, 14, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 15, 16, 17, 7, 18, 19, 7, 20, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 7, 7, 7, 15, 16, 17, 7, 18, 19, 7, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 22, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, ], tree3_level2: &[ 0, 1, 2, 3, 4, 5, 4, 6, 4, 4, 7, 8, 9, 10, 11, 12, 2, 2, 13, 14, 15, 16, 17, 4, 2, 2, 2, 2, 18, 19, 20, 4, 21, 22, 23, 24, 25, 4, 26, 4, 27, 28, - 29, 30, 31, 32, 33, 4, 2, 34, 35, 35, 36, 4, 4, 4, 4, 4, 37, 38, 39, 40, - 41, 42, 2, 43, 3, 44, 45, 46, 2, 47, 48, 49, 50, 51, 52, 53, 4, 4, 2, 54, - 2, 55, 4, 4, 56, 57, 2, 58, 59, 60, 61, 62, 4, 4, 3, 4, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 59, 4, 4, 4, 4, 72, 73, 74, 4, 75, 76, 77, 4, 4, 4, 4, - 78, 79, 80, 81, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 82, 4, 2, 83, - 2, 2, 2, 84, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 85, 86, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 87, 88, 4, 4, 4, 4, 4, 4, 4, 4, + 29, 30, 31, 32, 33, 4, 2, 34, 35, 35, 36, 4, 4, 4, 4, 4, 37, 4, 38, 39, + 40, 41, 2, 42, 3, 43, 44, 45, 2, 46, 47, 4, 48, 49, 50, 51, 4, 4, 2, 52, + 2, 53, 4, 4, 54, 55, 2, 56, 57, 58, 59, 60, 4, 4, 3, 4, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 57, 4, 4, 4, 4, 70, 71, 72, 4, 73, 74, 75, 4, 4, 4, 4, + 76, 4, 4, 77, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 78, 4, 2, 79, + 2, 2, 2, 80, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 81, 82, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 79, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 60, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, - 2, 2, 2, 2, 2, 2, 2, 59, 89, 69, 90, 18, 91, 92, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 2, 4, 4, 2, 93, 94, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 57, 83, 67, 84, 18, 85, 86, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 2, 4, 4, 2, 87, 88, 89, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 96, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 88, 34, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 2, 2, 2, 90, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 91, 34, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 97, 2, 2, 2, 2, 98, 99, 2, 2, 2, 2, 2, 100, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 92, 2, 2, 2, 2, 93, 94, 2, 2, 2, 2, 2, 95, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 2, 101, 102, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 2, 96, 97, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 103, 62, 4, 4, 4, 4, 4, 4, 4, 104, 105, 4, 4, 106, 4, - 4, 4, 4, 4, 4, 2, 107, 108, 109, 110, 111, 2, 2, 2, 2, 112, 113, 114, 115, - 116, 117, 4, 4, 4, 4, 4, 4, 4, 4, 118, 119, 120, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 121, 4, 4, 4, 122, 123, 124, 4, 125, 126, 4, 4, - 4, 4, 127, 128, 4, 4, 4, 4, 4, 4, 4, 129, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 130, 2, 2, 2, 131, 2, 132, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 133, 134, 135, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 98, 60, 4, 4, 4, 4, 4, 4, 4, 99, 100, 4, 4, 101, 4, 4, + 4, 4, 4, 4, 2, 102, 103, 104, 105, 106, 2, 2, 2, 2, 107, 108, 109, 110, + 111, 112, 4, 4, 4, 4, 4, 4, 4, 4, 113, 114, 115, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 23, 4, 4, 4, 116, 4, 4, 4, 117, 118, 4, 4, 4, + 4, 119, 120, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 121, + 2, 2, 2, 122, 2, 123, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 124, 125, 126, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 136, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 137, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 4, 4, 4, 4, 4, 4, 4, 4, 127, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 128, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 2, 2, 2, - 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 57, 2, 2, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 138, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, - 2, 2, 2, 140, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 87, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 130, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, + 2, 131, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 132, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 87, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 133, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, ], tree3_level3: &[ 0xB7FFFF7FFFFFEFFF, 0x3FFF3FFF, 0xFFFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF, 0, @@ -197,34 +195,32 @@ pub const XID_CONTINUE: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { 0x37FFFF00000000, 0x3FFFFFF003FFFFF, 0xC0FFFFFFFFFFFFFF, 0x873FFFFFFEEFF06F, 0x1FFFFFFF00000000, 0x1FFFFFFF, 0x7FFFFFFEFF, 0x3FFFFFFFFFFFFF, 0x7FFFF003FFFFF, 0x3FFFF, 0x1FF, 0x7FFFFFFFFFFFF, - 0x3FF00FFFFFFFFFF, 0x31BFFFFFFFFFF, 0xE000000000000000, - 0xFFFF00801FFFFFFF, 0xFFFF00000001FFFF, 0xFFFF00000000003F, - 0x7FFFFF0000001F, 0x803FFFC00000007F, 0x3FF01FFFFFF0004, - 0xFFDFFFFFFFFFFFFF, 0x4FFFFFFFFF00F0, 0x17FFDE1F, 0xC0FFFFFFFFFBFFFF, 0x3, - 0xFFFF01FFBFFFBD7F, 0x3FF07FFFFFFFFFF, 0xFBEDFDFFFFF99FEF, - 0x1F1FCFE081399F, 0x3C3FF07FF, 0x3FF00BF, 0xFF3FFFFFFFFFFFFF, 0x3F000001, - 0x3FF0011, 0x1FFFFFFFFFFFFFF, 0x3FF, 0x3FF0FFFE7FFFFFF, 0x7F, - 0xFFFFFFFF00000000, 0x800003FFFFFFFFFF, 0xF9BFFFFFFF6FF27F, 0x3FF000F, - 0xFFFFFCFF00000000, 0x1BFCFFFFFF, 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFF0080, - 0xFFFF000023FFFFFF, 0xFF7FFFFFFFFFFDFF, 0xFFFC000003FF0001, - 0x7FFEFFFFFCFFFF, 0xB47FFFFFFFFFFB7F, 0xFFFFFDBF03FF00FF, 0x3FF01FB7FFF, - 0x7FFFFF00000000, 0xC7FFFFFFFFFDFFFF, 0x3FF0007, 0x1000000000000, - 0x3FFFFFF, 0x7FFFFFFFFFFF, 0xF, 0xFFFFFFFFFFFF0000, 0x1FFFFFFFFFFFF, - 0xFFFFFFFFFFFF, 0x3FFFFF, 0xFFFF03FF7FFFFFFF, 0x1F3FFFFFFF03FF, - 0xE0FFFFF803FF000F, 0xFFFF, 0xFFFFFFFFFFFF87FF, 0xFFFF80FF, - 0x3001B00000000, 0xFFFFFFFFFFFFFF, 0x6FEF000000000000, 0x40007FFFFFFFF, - 0xFFFF00F000270000, 0xFFFFFFFFFFFFFFF, 0x1FFF07FFFFFFFFFF, 0x63FF01FF, - 0xFFFF3FFFFFFFFFFF, 0xF807E3E000000000, 0x3C0000000FE7, 0x1C, - 0xFFFFFFFFFFDFFFFF, 0xEBFFDE64DFFFFFFF, 0xFFFFFFFFFFFFFFEF, - 0x7BFFFFFFDFDFE7BF, 0xFFFFFFFFFFFDFC5F, 0xFFFFFF3FFFFFFFFF, - 0xF7FFFFFFF7FFFFFD, 0xFFDFFFFFFFDFFFFF, 0xFFFF7FFFFFFF7FFF, - 0xFFFFFDFFFFFFFDFF, 0xFFFFFFFFFFFFCFF7, 0xF87FFFFFFFFFFFFF, - 0x201FFFFFFFFFFF, 0xFFFEF8000010, 0x7E07FFFFFFF, 0xFFFF07DBF9FFFF7F, - 0x3FFFFFFFFFFF, 0x8000, 0x3FFF1FFFFFFFFFFF, 0x43FF, 0x7FFFFFFF0000, - 0x3FFFFFFFFFFFFFF, 0x3FFFFFFFFFF0000, 0x7FFF6F7F00000000, 0x7F001F, - 0x3FF0FFF, 0xAF7FE96FFFFFFEF, 0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF, + 0x3FF00FFFFFFFFFF, 0x31BFFFFFFFFFF, 0xFFFF00801FFFFFFF, + 0xFFFF00000001FFFF, 0xFFFF00000000003F, 0x7FFFFF0000001F, + 0x803FFFC00000007F, 0x3FF01FFFFFF0004, 0xFFDFFFFFFFFFFFFF, + 0x4FFFFFFFFF00F0, 0x17FFDE1F, 0x40FFFFFFFFFBFFFF, 0xFFFF01FFBFFFBD7F, + 0x3FF07FFFFFFFFFF, 0xFBEDFDFFFFF99FEF, 0x1F1FCFE081399F, 0x3C3FF07FF, + 0x3FF00BF, 0xFF3FFFFFFFFFFFFF, 0x3F000001, 0x3FF0011, 0x1FFFFFFFFFFFFFF, + 0x3FF, 0x3FF0FFFE7FFFFFF, 0x7F, 0xFFFFFFFF00000000, 0x800003FFFFFFFFFF, + 0xF9BFFFFFFF6FF27F, 0x3FF000F, 0xFFFFFCFF00000000, 0x1BFCFFFFFF, + 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFF0080, 0xFFFF000023FFFFFF, + 0xFF7FFFFFFFFFFDFF, 0xFFFC000003FF0001, 0x7FFEFFFFFCFFFF, + 0xB47FFFFFFFFFFB7F, 0xFFFFFDBF03FF00FF, 0x3FF01FB7FFF, 0x7FFFFF00000000, + 0x1000000000000, 0x3FFFFFF, 0x7FFFFFFFFFFF, 0xF, 0xFFFFFFFFFFFF0000, + 0x1FFFFFFFFFFFF, 0xFFFF03FF7FFFFFFF, 0x1F3FFFFFFF03FF, 0xE0FFFFF803FF000F, + 0xFFFF, 0xFFFFFFFFFFFF87FF, 0xFFFF80FF, 0x3001B00000000, 0xFFFFFFFFFFFFFF, + 0x3FFFFF, 0x6FEF000000000000, 0x7FFFFFFFF, 0xFFFF00F000070000, + 0xFFFFFFFFFFFFFFF, 0x1FFF07FFFFFFFFFF, 0x63FF01FF, 0xFFFF3FFFFFFFFFFF, + 0xF807E3E000000000, 0x3C0000000FE7, 0x1C, 0xFFFFFFFFFFDFFFFF, + 0xEBFFDE64DFFFFFFF, 0xFFFFFFFFFFFFFFEF, 0x7BFFFFFFDFDFE7BF, + 0xFFFFFFFFFFFDFC5F, 0xFFFFFF3FFFFFFFFF, 0xF7FFFFFFF7FFFFFD, + 0xFFDFFFFFFFDFFFFF, 0xFFFF7FFFFFFF7FFF, 0xFFFFFDFFFFFFFDFF, + 0xFFFFFFFFFFFFCFF7, 0xF87FFFFFFFFFFFFF, 0x201FFFFFFFFFFF, 0xFFFEF8000010, + 0x7DBF9FFFF7F, 0x3FFF1FFFFFFFFFFF, 0x43FF, 0x7FFFFFFF0000, + 0x3FFFFFFFFFFFFFF, 0x7FFF6F7F00000000, 0x7F001F, 0x3FF0FFF, + 0xAF7FE96FFFFFFEF, 0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF, 0x3FF000000000000, 0xFFFFFFFF, 0xFFFF0003FFFFFFFF, 0x1FFFFFFFF, - 0x3FFFFFFF, 0xFFFFFFFFFFFF07FF, + 0x3FFFFFFF, 0x7FF, 0xFFFFFFFFFFFF, ], }; @@ -340,7 +336,7 @@ pub const XID_START: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { ], tree3_level1: &[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 5, 9, 10, 5, 11, 12, 5, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 13, 14, 15, 7, 16, 17, 7, 18, 19, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 7, 7, 13, 14, 15, 7, 16, 17, 7, 18, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, @@ -349,63 +345,61 @@ pub const XID_START: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, ], tree3_level2: &[ 0, 1, 2, 3, 4, 5, 4, 4, 4, 4, 6, 7, 8, 9, 10, 11, 2, 2, 12, 13, 14, 15, 16, 4, 2, 2, 2, 2, 17, 18, 19, 4, 20, 21, 22, 23, 24, 4, 25, 4, 26, 27, 28, 29, 30, 31, 32, 4, 2, 33, 34, 34, 35, 4, 4, 4, 4, 4, 36, 4, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 22, 52, 53, 4, 4, 5, - 54, 55, 56, 4, 4, 57, 58, 55, 59, 60, 4, 61, 62, 4, 4, 63, 4, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 4, 4, 4, 4, 74, 75, 76, 4, 77, 78, 79, 4, 4, - 4, 4, 80, 81, 4, 82, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 83, 4, - 2, 57, 2, 2, 2, 84, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 85, 86, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 55, 87, 4, 4, 4, 4, 4, 4, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 4, 50, 22, 51, 52, 4, 4, 5, + 53, 54, 55, 4, 4, 56, 57, 54, 58, 59, 4, 60, 61, 4, 4, 62, 4, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 4, 4, 4, 4, 73, 74, 75, 4, 76, 77, 78, 4, 4, + 4, 4, 79, 4, 4, 80, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 81, 4, 2, + 56, 2, 2, 2, 82, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 83, 84, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 56, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 61, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 2, 2, 2, 2, 2, 2, 2, 2, 73, 88, 89, 90, 55, 91, 76, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 2, 4, 4, 2, 92, 93, 94, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 72, 85, 86, 87, 54, 88, 75, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 2, 4, 4, 2, 89, 90, 91, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 96, 33, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 2, 2, 2, 2, 92, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 93, 33, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 97, 2, 2, 2, 2, 98, 99, 2, 2, 2, 2, 2, 100, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 94, 2, 2, 2, 2, 95, 96, 2, 2, 2, 2, 2, 97, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 2, 101, 102, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 103, 104, 105, 106, 107, - 2, 2, 2, 2, 108, 109, 110, 111, 112, 113, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 114, 4, 4, 4, 115, 116, - 4, 4, 117, 118, 4, 4, 4, 4, 90, 63, 4, 4, 4, 4, 4, 4, 4, 119, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 120, 2, 2, 2, 121, 2, 122, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 123, 124, 125, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 126, 2, 2, + 4, 4, 4, 4, 4, 2, 98, 99, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 100, 101, 102, 103, 104, 2, 2, + 2, 2, 105, 106, 107, 108, 109, 110, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 4, 4, 4, 111, + 112, 4, 4, 4, 4, 87, 62, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 113, 2, 2, 2, 114, 2, 115, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 116, 117, 118, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 127, 2, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 72, 2, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 128, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 120, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2, 2, 2, 2, 2, 2, 121, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 130, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 131, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 55, + 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 122, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 123, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, ], tree3_level3: &[ 0xB7FFFF7FFFFFEFFF, 0x3FFF3FFF, 0xFFFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF, 0, @@ -420,25 +414,23 @@ pub const XID_START: &'static ::ucd_trie::TrieSet = &::ucd_trie::TrieSet { 0x303FFFFFFFFFF, 0xFFFF00801FFFFFFF, 0xFFFF00000000003F, 0xFFFF000000000003, 0x7FFFFF0000001F, 0xFFFFFFFFFFFFF8, 0x26000000000000, 0xFFFFFFFFFFF8, 0x1FFFFFF0000, 0x7FFFFFFFF8, 0x47FFFFFFFF0090, - 0x7FFFFFFFFFFF8, 0x1400001E, 0x80000FFFFFFBFFFF, 0x1, 0xFFFF01FFBFFFBD7F, + 0x7FFFFFFFFFFF8, 0x1400001E, 0xFFFFFFBFFFF, 0xFFFF01FFBFFFBD7F, 0x23EDFDFFFFF99FE0, 0x3E0010000, 0x380000780, 0xFFFFFFFFFFFF, 0xB0, 0x7FFFFFFFFFFF, 0xF000000, 0x10, 0x10007FFFFFFFFFF, 0x7FFFFFF, 0x7F, 0xFFFFFFFFFFF, 0xFFFFFFFF00000000, 0x80000000FFFFFFFF, 0x8000FFFFFF6FF27F, 0x2, 0xFFFFFCFF00000000, 0xA0001FFFF, 0x407FFFFFFFFF801, 0xFFFFFFFFF0010000, 0xFFFF0000200003FF, 0x1FFFFFFFFFFFFFF, 0x7FFFFFFFFDFF, 0xFFFC000000000001, 0xFFFF, 0x1FFFFFFFFFB7F, 0xFFFFFDBF00000040, - 0x10003FF, 0x7FFFF00000000, 0xFFFFFFFFDFFF4, 0x1000000000000, 0x3FFFFFF, - 0xF, 0xFFFFFFFFFFFF0000, 0x1FFFFFFFFFFFF, 0x7E, 0xFFFF00007FFFFFFF, + 0x10003FF, 0x7FFFF00000000, 0x1000000000000, 0x3FFFFFF, 0xF, + 0xFFFFFFFFFFFF0000, 0x1FFFFFFFFFFFF, 0xFFFF00007FFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x3FFFFFFF0000, 0xE0FFFFF80000000F, 0x107FF, 0xFFF80000, 0xB00000000, 0xFFFFFFFFFFFFFF, 0x3FFFFF, 0x6FEF000000000000, - 0x40007FFFFFFFF, 0xFFFF00F000270000, 0xFFFFFFFFFFFFFFF, - 0x1FFF07FFFFFFFFFF, 0x3FF01FF, 0xFFFFFFFFFFDFFFFF, 0xEBFFDE64DFFFFFFF, - 0xFFFFFFFFFFFFFFEF, 0x7BFFFFFFDFDFE7BF, 0xFFFFFFFFFFFDFC5F, - 0xFFFFFF3FFFFFFFFF, 0xF7FFFFFFF7FFFFFD, 0xFFDFFFFFFFDFFFFF, - 0xFFFF7FFFFFFF7FFF, 0xFFFFFDFFFFFFFDFF, 0xFF7, 0x7E07FFFFFFF, - 0xFFFF000000000000, 0x3FFFFFFFFFFF, 0x3F801FFFFFFFFFFF, 0x4000, - 0xFFFFFFF0000, 0x7FFF6F7F00000000, 0x1F, 0x80F, 0xAF7FE96FFFFFFEF, - 0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF, 0xFFFFFFFF, 0x3FFFFFFFFFFFFFF, - 0xFFFF0003FFFFFFFF, 0x1FFFFFFFF, 0x3FFFFFFF, 0xFFFFFFFFFFFF07FF, + 0x7FFFFFFFF, 0xFFFF00F000070000, 0xFFFFFFFFFFFFFFF, 0x1FFF07FFFFFFFFFF, + 0x3FF01FF, 0xFFFFFFFFFFDFFFFF, 0xEBFFDE64DFFFFFFF, 0xFFFFFFFFFFFFFFEF, + 0x7BFFFFFFDFDFE7BF, 0xFFFFFFFFFFFDFC5F, 0xFFFFFF3FFFFFFFFF, + 0xF7FFFFFFF7FFFFFD, 0xFFDFFFFFFFDFFFFF, 0xFFFF7FFFFFFF7FFF, + 0xFFFFFDFFFFFFFDFF, 0xFF7, 0x3F801FFFFFFFFFFF, 0x4000, 0x7FFF6F7F00000000, + 0x1F, 0x80F, 0xAF7FE96FFFFFFEF, 0x5EF7F796AA96EA84, 0xFFFFBEE0FFFFBFF, + 0xFFFFFFFF, 0xFFFF0003FFFFFFFF, 0x1FFFFFFFF, 0x3FFFFFFF, 0x7FF, ], }; diff --git a/record.txt b/record.txt index 15e1cbf6e0cacd9bd28a930202398fdef299d533..14e58f4898bbf95e5301f8099b0158e2e0a47661 100644 --- a/record.txt +++ b/record.txt @@ -41,3 +41,4 @@ 63 64 65 +66